Encountered this issue during deployment on Vercel. Npm run build did not show any errors.
Configuration : "node": "18", "next": "^14.0.0", "next-transpile-modules": "^9.1.0",
An error occurred during the build
TypeError: Cannot read properties of undefined (reading 'and')
at Object.webpack (/vercel/path0/node_modules/next-transpile-modules/src/next-transpile-modules.js:206:60)
at getBaseWebpackConfig (/vercel/path0/node_modules/next/dist/build/webpack-config.js:1713:32)
...
Unclear about the source of the error, as everything was functioning correctly previously
Here is my next.config.js : const withTM = require("next-transpile-modules")(["gsap"])
module.exports = withTM({
images: {
domains: ["res.cloudinary.com"],
loader: "cloudinary",
path: "https://res.cloudinary.com/",
},
i18n: {...}
})
The section causing the error :
if (nextCssLoader) { nextCssLoader.issuer.or = nextCssLoader.issuer.and ? nextCssLoader.issuer.and.concat(matcher) : matcher; delete nextCssLoader.issuer.not; delete nextCssLoader.issuer.and; } else { console.warn('next-transpile-modules - could not find default CSS rule, CSS imports may not work'); }