we have build error undefined (reading 'NormalModule')

Viewed 975

Our company is facing build errors in multiple repo's without npm changes only code changes.

Below is the log output.

 ERROR  TypeError: Cannot read properties of undefined (reading 'NormalModule')
TypeError: Cannot read properties of undefined (reading 'NormalModule')
    at VueLoaderPlugin.apply (/home/vsts/work/1/s/crm-module/node_modules/vue-loader-v16/dist/pluginWebpack5.js:44:47)
    at webpack (/home/vsts/work/1/s/crm-module/node_modules/@vue/cli-service/node_modules/webpack/lib/webpack.js:51:13)
    at /home/vsts/work/1/s/crm-module/node_modules/@vue/cli-service/lib/commands/build/index.js:200:5
    at new Promise (<anonymous>)
    at build (/home/vsts/work/1/s/crm-module/node_modules/@vue/cli-service/lib/commands/build/index.js:199:10)
    at async /home/vsts/work/1/s/crm-module/node_modules/@vue/cli-service/lib/commands/build/index.js:89:7
npm timing command:run-script Completed in 2369ms
1 Answers

This is perhaps a problem with webpack5. I fixed it with:

npm install webpack@4.39.3 --save
Related