Angular build Error genMapping.encodedMap is not a function

Viewed 48

I am facing a new error while trying to run my Angular 13 version project locally. This happened after I installed Node js 16.6 yesterday.

This is the first line of the error:

Error: Module build failed (from ./node_modules/@angular-devkit/build- 
angular/src/babel/webpack-loader.js):
 TypeError: genMapping.encodedMap is not a function

Here is further details of the error dump:

Error: Module build failed (from ./node_modules/@angular-devkit/build- 
angular/src/babel/webpack-loader.js):
TypeError: genMapping.encodedMap is not a function
at new SourceMap (C:\BreakPack\temp\breakpack-manager- 
ui\node_modules\@ampproject\remapping\dist\remapping.umd.js:169:91)
at remapping (C:\BreakPack\temp\breakpack-manager- 
ui\node_modules\@ampproject\remapping\dist\remapping.umd.js:203:16)
at Object.result (C:\BreakPack\temp\breakpack-manager-ui\node_modules\@angular- 
devkit\build-angular\src\babel\webpack-loader.js:210:48)
at Object.<anonymous> (C:\BreakPack\temp\breakpack-manager-ui\node_modules\babel- 
loader\lib\index.js:221:43)
at Generator.next (<anonymous>)
at asyncGeneratorStep (C:\BreakPack\temp\breakpack-manager-ui\node_modules\babel- 
 loader\lib\index.js:3:103)
at _next (C:\BreakPack\temp\breakpack-manager-ui\node_modules\babel- 
loader\lib\index.js:5:194)

Can someone tell me what's wrong or what I need to do to resolve this issue?

1 Answers

The error isn't helpful, but the reason it happens is because a package in your node_modules (@jridgewell/gen-mapping) is missing. which could be for a number of reason like installation errors, symlinking dependencies in certain ways, etc.

More details: https://github.com/ampproject/remapping/issues/180

To fix the issue, double check that your dependencies are properly installed, and that the particular package is present in node_modules.

Related