Search code examples
webpack

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


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)

Solution

  • 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.