Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Content and Map of this Source is not available" error after upgrading to Webpack 5

Tags:

webpack

My project was working fine. When I upgraded to Webpack 5 this issue occurred. I searched online, but all the discussions seem to be from a previous version and I even tried the workarounds specified, but to no avail.

\SourceCode\node_modules\webpack\node_modules\webpack-sources\lib\SizeOnlySource.js:26 throw this._error(); ^ Error: Content and Map of this Source is not available (only size() is supported)

like image 594
Abhilash K Avatar asked Feb 10 '21 05:02

Abhilash K


2 Answers

Sometimes, such errors occur as a result of incorrect assembly. Most likely angular using a webpack just made changes with an error. Try to delete the .angular folder, then run the

npm install

command and run the project with the usual command:

ng serve --open

If there is an error, try clearing the cache, or running your IDE as administrator.

like image 127
Igor Vasiliev Avatar answered Nov 07 '22 07:11

Igor Vasiliev


When I've disabled the sourceMap generation (for both local and prod configuration) the error no longer occured. Keep in mind this would work for some people, depends on the scenario. In my case I dont need sourceMaps even on local env:

enter image description here

I believe this problem is related somehow to Angular (as I have Angular project), and this might be something that they should address, instead of making changes on our angular.json file config.

like image 6
Zdravko Kolev Avatar answered Nov 07 '22 05:11

Zdravko Kolev