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

Does not work with webpack5 flag #31

Closed elado closed 3 years ago

elado commented 3 years ago

webpack5 support is still in beta in nextjs. Looks like this plugin fails to load due to some internals changes.

const withAntdLess = require("next-plugin-antd-less");

module.exports = withAntdLess({
  future: {
    webpack5: true,
  },
});
(node:62355) [DEP_WEBPACK_EXTERNALS_FUNCTION_PARAMETERS] DeprecationWarning: The externals-function should be defined like ({context, request}, cb) => { ... }
(node:62355) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'startsWith' of undefined
    at handleExternals (<root>/node_modules/next/build/webpack-config.ts:609:15)
    at Array.webpackConfig.externals._webpack.isWebpack5.require.resolve.paths (<root>/node_modules/next/build/webpack-config.ts:755:21)
    at config.externals (<root>/node_modules/next-plugin-antd-less/index.js:146:24)
    at <root>/node_modules/next/dist/compiled/webpack/bundle5.js:48316:21
SolidZORO commented 3 years ago

Yes, the webpack5 ecosystem is currently unstable and still in beta in next.js, so I don't plan to support it yet. I will be compatible when it is stable.

giscafer commented 2 years ago

same error in next 10.1.0, plugin v0.3.0

SolidZORO commented 2 years ago

same error in next 10.1.0, plugin v0.3.0

@giscafer can you show me more error info?

giscafer commented 2 years ago

same error in next 10.1.0, plugin v0.3.0

@giscafer can you show me more error info?

upgrade to latest version it works fine