[英]Can't resolve all parameters for ApplicationModule: (?) - Angular 7 JIT
Hello i am facing issue which looks to be appear randomly.您好,我正面临看起来随机出现的问题。 All my setup was working like charm.我所有的设置都像魅力一样工作。
I have couple of angular application compiled with webpack.我有几个用 webpack 编译的 angular 应用程序。 all work fine in AOT but crash on JIT.在 AOT 中一切正常,但在 JIT 上崩溃。 It because the compiler are not able to understand annotation.这是因为编译器无法理解注释。
compiler.js:2700 Uncaught Error: Can't resolve all parameters for ApplicationModule: (?).
at syntaxError (compiler.js:2700)
at CompileMetadataResolver._getDependenciesMetadata (compiler.js:19254)
I use "core-js": "^2.6.5"
(i have also try with 3.0.1
)我使用"core-js": "^2.6.5"
(我也尝试过3.0.1
)
I have on my polyfill.ts
all reflect as following :我在我的polyfill.ts
都反映如下:
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
my webpack configure contain following rules :我的 webpack 配置包含以下规则:
[
{
loader: 'babel-loader',
options: babelOptions
},
{
loader: 'ts-loader',
options: {
transpileOnly: true
}
},
{
loader: 'angular2-template-loader'
}
]
And my babel configuration looks like this :我的 babel 配置如下所示:
presets: [
[
'@babel/preset-env',
{
modules: false,
loose: true,
targets: {
browsers: [
"last 2 versions",
"not ie <= 10"
]
},
useBuiltIns: 'usage',
corejs: "2",
debug: false
}
]
]
What i have try so far ?到目前为止我尝试了什么?
You can have look on minimal proof of issue on this Github repo您可以查看此Github 存储库上的最小问题证明
I have an Angular Application in v5 and recently upgraded to v9, purely add import 'core-js/es7/reflect';
我在 v5 中有一个 Angular 应用程序,最近升级到 v9,纯粹添加import 'core-js/es7/reflect';
to the top of boot.ts or polyfill.ts cannot fix the problem到 boot.ts 或 polyfill.ts 的顶部无法解决问题
But once I load reflect-metadata in the very first line, everything fixed.但是一旦我在第一行加载了reflect-metadata,一切就都解决了。
import 'reflect-metadata';
import 'core-js/es7/reflect';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.