简体   繁体   English

未定义 fetchCompletion 中的错误 - Angular 10 Visual Studio 代码

[英]ERROR in fetchCompletion is not defined - Angular 10 visual studio code

I have an angular 10 project (using visual studio code as editor) with different modules.我有一个带有不同模块的 angular 10 项目(使用 Visual Studio 代码作为编辑器)。 All modules are building properly but when I try to run(ng serve) the application I'm getting an exception所有模块都在正确构建,但是当我尝试运行(ng serve)应用程序时出现异常

ERROR in fetchCompletion is not defined fetchCompletion中的错误未定义

Tried uninstalling and installing the node and cli, even after that projects are building without any errors while doing ng serve same exception is getting:尝试卸载和安装节点和 cli,即使在项目构建时没有任何错误,同时执行ng serve相同的异常得到:

These are the version details:这些是版本详细信息:

角度版本详细信息

And These are the error details:这些是错误详细信息:

错误详情

Along with the error, it shows the message ** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ ** .随着错误,它显示消息** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ ** But when I open the same port [ http://localhost:4200/ ] it says Cannot GET / .但是当我打开同一个端口 [ http://localhost:4200/ ] 时,它会显示Cannot GET / the corresponding request in the network says bad request网络中对应的请求说bad request

请求失败

Tried the following actions to fix the issues, but nothing helped:尝试了以下操作来解决问题,但没有任何帮助:

  • Get the latest source code, undo the changes in package.config, and build the project again.(the latest code is working fine for other team members).获取最新的源代码,撤消 package.config 中的更改,然后重新构建项目。(最新的代码对其他团队成员工作正常)。
  • uninstalled the npm and install the same again卸载 npm 并再次安装
  • Clear the npm cache清除npm缓存
  • uninstall and install node js, restarted the machine卸载并安装node js,重启机器

Please note: I tried the following command node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng serve as well but still getting the same error.请注意:我也尝试了以下命令node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng serve但仍然遇到相同的错误。 Can someone help me to resolve the issues, Please let me know if more details needed to understand the root cause有人可以帮我解决问题吗,如果需要更多详细信息来了解根本原因,请告诉我

I was facing the specific issue because the loader.js got corrupted and the corresponding loaded.ts was not getting compiled.我遇到了特定问题,因为loader.js已损坏并且相应的 load.ts 未编译。 The specific file was located at具体文件位于

node_modules\@angular\compiler-cli\src\ngtsc\resource\src\loader.js

As one of my friends suggested, I deleted the files and do one npm install to resolve the issue.正如我的一位朋友建议的那样,我删除了文件并npm install以解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM