该源的内容和图不可用(仅支持大小())Angular 13

发布于 2025-01-28 07:36:35 字数 1739 浏览 4 评论 0原文

我一直在使用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)

我尝试了这些解决方案。其中没有一个是永久解决方案。

  1. 从项目中删除.angular文件夹并运行 npm安装,然后是 npm运行start start 命令

  2. set sourcemap flag as false false

  3. 尝试使用 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.

  1. Remove .angular folder from project and run npm install followed by npm run start command

  2. set sourceMap flag as false

  3. Tried to install sourceMap using npm install command

webpack version

enter image description here

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

夏九 2025-02-04 07:36:35

从答案中找到在这里。简而言之的是,.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 run npm install to recreate a bug free version, and then run ng serve (or npm run start if that's what you're used to).

乜一 2025-02-04 07:36:35

我的角度为14.2.12,fix是删除建立在应用程序根部的“角”文件夹。

I have Angular 14.2.12 and fix was to delete ".angular" folder, founded in the root of the application.

恋你朝朝暮暮 2025-02-04 07:36:35

删除.angular和.node_modules。比运行NPM安装,AFATER NPM启动

Delete .angular and .node_modules. Than run npm install, afater npm start

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文