Closed startmt closed 2 years ago
Update next-with-less
to 2.0.2
Hello, I'm facing the same issue.
package.json
"dependencies": {
"antd": "^4.17.2",
"next": "12.0.5",
"next-with-less": "^2.0.2",
"react": "17.0.2",
"react-dom": "17.0.2"
},
next.config.js
/** @type {import('next').NextConfig} */
const withLess = require("next-with-less");
module.exports = withLess({
reactStrictMode: true,
lessLoaderOptions: {}
})
Despite my previous comment, I can actually reproduce it too.
So what was fixed in 2.0.2
resurfaced again with next: 12.0.5
I'm having the same issue with the exact same setup, except I'm using next: 12.0.7
same error and but also using next-optimized-images
"dependencies": {
"antd": "^4.16.13",
"next": "12.0.7",
"next-with-less": "^2.0.2",
"next-optimized-images": "^2.6.2",
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
TypeError: Cannot read property 'oneOf' of undefined
at Object.webpack (PROJECT/node_modules/next-with-less/dist/index.js:66:15)
at Object.webpack (PROJECT/node_modules/next-optimized-images/lib/index.js:66:27)
at Object.getBaseWebpackConfig [as default] (PROJECT/node_modules/next/build/webpack-config.ts:1722:6)
at async Promise.all (index 0)
at Span.traceAsyncFn (PROJECT/node_modules/next/trace/trace.ts:96:14)
at Span.traceAsyncFn (PROJECT/node_modules/next/trace/trace.ts:96:14)
at HotReloader.start (PROJECT/node_modules/next/server/dev/hot-reloader.ts:438:21)
at DevServer.prepare (PROJECT/node_modules/next/server/dev/next-dev-server.ts:389:5)
at ViewService.onModuleInit (PROJECT/src/server/view/view.service.ts:18:7)
at async Promise.all (index 0)
Thanks for reporting. Fixed in 2.0.4.
TypeError: Cannot read properties of undefined (reading 'oneOf') at Object.webpack (xxxx/node_modules/next-with-less/dist/index.js:66:15)
I can't use it in next lastest version