Skip to content

Migrate from Babel to Nextjs SWC encountering Minified React error #63870

Closed Answered by LeVuMinhHuy
LeVuMinhHuy asked this question in Help
Discussion options

You must be logged in to vote

I found the reason, it's inline-react-svg cause this issue. Remove .babelrc file and add this config to webpack inside next.config.js and it will work

webpack: (config, options) => {
      config.module.rules.push({
      test: /\.svg$/,
      use: [
        options.defaultLoaders.babel,
        {
          loader: "@svgr/webpack",
          options: { babel: false },
        },
      ],
    });

    return config;
  },

Thank you !

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LeVuMinhHuy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant