该源的内容和图不可用(仅支持大小())Angular 13
我一直在使用Angular Project,并且Angular版本为13,节点为16个版本。
当我使用命令npm运行启动
时,它会引发错误(编译错误)。粘贴了下面的错误,
Error: Content and Map of this Source is not available (only size() is supported)
at SizeOnlySource._error (C:\Users\proj\node_modules\webpack-sources\lib\SizeOnlySource.js:16:10)
at SizeOnlySource.buffer (C:\Users\proj\node_modules\webpack-sources\lib\SizeOnlySource.js:30:14)
at _isSourceEqual (C:\Users\proj\node_modules\webpack\lib\util\source.js:21:51)
at isSourceEqual (C:\Users\proj\node_modules\webpack\lib\util\source.js:43:17)
at Compilation.emitAsset (C:\Users\proj\node_modules\webpack\lib\Compilation.js:4171:9)
at C:\Users\proj\node_modules\webpack\lib\Compiler.js:548:28
at C:\Users\proj\node_modules\webpack\lib\Compiler.js:1129:17
at eval (eval at create (C:\Users\proj\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:13:1)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
我尝试了这些解决方案。其中没有一个是永久解决方案。
从项目中删除.angular文件夹并运行 npm安装,然后是 npm运行start start 命令
set sourcemap flag as false false
尝试使用 npm npm install command
尝试安装 sourcemap
webpack版本
这些解决方案是从其他StackoverFolw的其他类似问题中获取的。
任何人都知道为什么会出现这个错误。
我们有一个永久解决方案吗? 期待更好的解决方案
I have been working with angular project and have angular version is 13 and node is 16 versions.
When i use command npm run start
its throwing an error(compilation error). Pasted the error below
Error: Content and Map of this Source is not available (only size() is supported)
at SizeOnlySource._error (C:\Users\proj\node_modules\webpack-sources\lib\SizeOnlySource.js:16:10)
at SizeOnlySource.buffer (C:\Users\proj\node_modules\webpack-sources\lib\SizeOnlySource.js:30:14)
at _isSourceEqual (C:\Users\proj\node_modules\webpack\lib\util\source.js:21:51)
at isSourceEqual (C:\Users\proj\node_modules\webpack\lib\util\source.js:43:17)
at Compilation.emitAsset (C:\Users\proj\node_modules\webpack\lib\Compilation.js:4171:9)
at C:\Users\proj\node_modules\webpack\lib\Compiler.js:548:28
at C:\Users\proj\node_modules\webpack\lib\Compiler.js:1129:17
at eval (eval at create (C:\Users\proj\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:13:1)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
I have tried these solution.None of them are permanent solutions.
Remove .angular folder from project and run npm install followed by npm run start command
set sourceMap flag as false
Tried to install sourceMap using npm install command
webpack version
These solutions are get it from the other stackoverfolw similar questions.
Anyone know why this error comes.
Do we have a permanent solution for this issue.
Expecting a better solution
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
从答案中找到在这里。简而言之的是,
.angular
在您的项目目录中找到的文件夹有时会损坏,而修复它的最佳方法是完全删除文件夹。然后运行npm install
以重新创建免费版本,然后运行ng服务
(或npm运行start start
如果您曾经用过)。From the answer found here. The short and sweet of it is that the
.angular
folder found in your project directory sometimes gets corrupted and the best way to fix it is to delete the folder entirely. Then runnpm install
to recreate a bug free version, and then runng serve
(ornpm run start
if that's what you're used to).我的角度为14.2.12,fix是删除建立在应用程序根部的“角”文件夹。
I have Angular 14.2.12 and fix was to delete ".angular" folder, founded in the root of the application.
删除.angular和.node_modules。比运行NPM安装,AFATER NPM启动
Delete .angular and .node_modules. Than run npm install, afater npm start