0

The documentation says that turbopack works with @svgr/webpack, but doesn't really want to work.

If you run the project without --turbo (turbopack), everything works fine. And if run with --turbo, it gives an error:

Error run turbopack:

Processing image failed
  Failed to parse svg source code for image dimensions
  
  Caused by:
  - Source code does not contain a <svg> root element

my next.config.js

const nextConfig = {
  webpack(config) {
    config.module.rules.push({
      test: /\.svg$/i,
      use: ["@svgr/webpack"],
    });

    return config;
  },

  experimental: {
    appDir: true,
    turbo: {
      loaders: {
        ".svg": ["@svgr/webpack"],
      },
    },
  },
};

module.exports = nextConfig;
Jonas
  • 121,568
  • 97
  • 310
  • 388

0 Answers0