我正在处理一个不断在控制台上抛出此错误的存储库:
Uncaught TypeError: this.getExtraNgModuleProviders is not a function.
这些项目在“ng serve”上编译得很好,但它在控制台上显示一个空白页面和那个错误。我尝试了很多事情,但我找不到出路。
我试过卸载和安装@angular/compiler,但没有用。问题似乎是 JitCompiler 没有找到this.getExtraNgModuleProviders
我认为this.getExtraNgModuleProvidersJitCompiler 中的函数应该this._getExtraNgModuleProviders在 compiler.js 上。因为它周围的所有功能似乎都包含下划线。
更新:
我不认为函数名称与它有任何关系,因为其他开发人员可以很好地运行该项目,并且他们拥有相同的 Jit compiler.js 文件。供参考:当我单击控制台上的错误时,这是我需要的地方
function JitCompiler(_metadataResolver, _templateParser, _styleCompiler, _viewCompiler, _ngModuleCompiler, _summaryResolver, _reflector, _compilerConfig, _console, getExtraNgModuleProviders) {
this._metadataResolver = _metadataResolver;
this._templateParser = _templateParser;
this._styleCompiler = _styleCompiler;
this._viewCompiler = _viewCompiler;
this._ngModuleCompiler = _ngModuleCompiler;
this._summaryResolver = _summaryResolver;
this._reflector = _reflector;
this._compilerConfig = _compilerConfig;
this._console = _console;
this.getExtraNgModuleProviders = getExtraNgModuleProviders;//<- error is pointed here
this._compiledTemplateCache = new Map();
this._compiledHostTemplateCache = …Run Code Online (Sandbox Code Playgroud)