image-trace-loader icon indicating copy to clipboard operation
image-trace-loader copied to clipboard

TypeError: unsupported file type: undefined (file: undefined)

Open chmielulu opened this issue 2 years ago • 0 comments

Hi, I'm trying to use your package together with [email protected], but I'm getting an error error - ./public/assets/handshake.png TypeError: unsupported file type: undefined (file: undefined).

My next.config.js where I push webpack config:

const { i18n } = require("./next-i18next.config");

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  i18n,
  trailingSlash: true,
  webpack(config) {
    config.module.rules.push(
      {
        type: "asset",
        resourceQuery: /url/,
      },
      {
        test: /\.svg$/,
        use: {
          loader: "@svgr/webpack",
          options: {
            svgoConfig: {
              plugins: [
                {
                  name: "preset-default",
                  params: {
                    overrides: {
                      mergePaths: false,
                    },
                  },
                },
                "prefixIds",
              ],
            },
          },
        },
      },
      {
        test: /\.(png|jpe?g|gif|jp2|webp)$/,
        use: [
          {
            loader: "image-trace-loader",
          },
        ],
      }
    );

    return config;
  },
  images: {
    domains: ["images.unsplash.com"],
  },
  async redirects() {
    return [
      {
        source: "/polityka-prywatnosci",
        destination: "/privacy-policy",
        permanent: true,
      },
    ];
  },
};

module.exports = nextConfig;

chmielulu avatar Apr 07 '22 10:04 chmielulu