SolidZORO / next-plugin-antd-less

🎩 Use Antd (Less) with Next.js v12, Zero Dependency on other Next-Plugins.
MIT License
345 stars 48 forks source link

Error with <Image /> component Antd #96

Closed qunahui closed 2 years ago

qunahui commented 2 years ago

I am using next-plugin-antd-less@1.5.2, antd@4.16.13 and next@12.0.3. Everything seems ok but when I use Image it will report an error:

image

my next.config.js:


  webpack(config) {
    config.module.rules.push({
      test: /\.svg$/,
      use: ['@svgr/webpack'],
    });
    const webpack = require('webpack');
    config.plugins.push(
      new webpack.ProvidePlugin({
        'window.Quill': 'quill/dist/quill.js',
        Quill: 'quill/dist/quill.js',
      })
    );
    return config;
  },

  rewrites: async () => nextI18NextRewrites(localeSubpaths),
  publicRuntimeConfig: {
    localeSubpaths,
  },
  env: {
  },
});```
qunahui commented 2 years ago

I fixed it by downgrading Next version to 12.0.2. Looks like this is a bug for the new version of Next.