(SystemJS) Can't resolve all parameters for
来源:互联网 发布:二手域名 编辑:程序博客网 时间:2024/04/25 15:41
angular4中添加service的DI注入后,编译后在tomcat下运行,一直提示
(SystemJS) Can't resolve all parameters for TestComponent: (?).syntaxError@http://localhost:8080/web/node_modules/@angular/compiler/bundles/compiler.umd.js:1513:34 [<root>]CompileMetadataResolver.prototype._getDependenciesMetadata@http://localhost:8080/web/node_modules/@angular/compiler/bundles/compiler.umd.js:14790:35 [<root>]CompileMetadataResolver.prototype._getTypeMetadata@http://localhost:8080/web/node_modules/@angular/compiler/bundles/compiler.umd.js:14658:21 [<root>]CompileMetadataResolver.prototype.getNonNormalizedDirectiveMetadata@http://localhost:8080/web/node_modules/@angular/compiler/bundles/compiler.umd.js:14267:19 [<root>]CompileMetadataResolver.prototype._getEntryComponentMetadata@http://localhost:8080/web/node_modules/@angular/compiler/bundles/compiler.umd.js:14911:40 [<root>]CompileMetadataResolver.prototype.getNgModuleMetadata/<@http://localhost:8080/web/node_modules/@angular/compiler/bundles/compiler.umd.js:14494:102 [<root>]CompileMetadataResolver.prototype.getNgModuleMetadata@http://localhost:8080/web/node_modules/@angular/compiler/bundles/compiler.umd.js:14494:53 [<root>]JitCompiler.prototype._loadModules@http://localhost:8080/web/node_modules/@angular/compiler/bundles/compiler.umd.js:25571:41 [<root>]JitCompiler.prototype._compileModuleAndComponents@http://localhost:8080/web/node_modules/@angular/compiler/bundles/compiler.umd.js:25530:47 [<root>]JitCompiler.prototype.compileModuleAsync@http://localhost:8080/web/node_modules/@angular/compiler/bundles/compiler.umd.js:25492:16 [<root>]PlatformRef_.prototype._bootstrapModuleWithZone@http://localhost:8080/web/node_modules/@angular/core/bundles/core.umd.js:4793:16 [<root>]PlatformRef_.prototype.bootstrapModule@http://localhost:8080/web/node_modules/@angular/core/bundles/core.umd.js:4779:16 [<root>]@http://localhost:8080/web/main.js:4:1 [<root>]@http://localhost:8080/web/main.js:1:31 [<root>]@http://localhost:8080/web/main.js:1:2 [<root>]scheduleResolveOrReject/<@http://localhost:8080/web/node_modules/zone.js/dist/zone.js:758:52 [<root>]drainMicroTaskQueue@http://localhost:8080/web/node_modules/zone.js/dist/zone.js:591:25 [<root>]ZoneTask/this.invoke@http://localhost:8080/web/node_modules/zone.js/dist/zone.js:464:25 [<root>]Evaluating http://localhost:8080/web/main.jsError loading http://localhost:8080/web/main.js index
但在源码环境下运行正常,于是奇怪了。后来想到编译打包使用的grunt-ts,而编译是angular4提供的样例工程自动编译的,这2者会不会有差异。用对比工具对比后发现,还真有差异。
//danielinbiti
首先少了
var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);};又少了
__metadata("design:paramtypes", [TestService_1.TestService])于是就出现了参数无法识别的错误。
看来编译方式还得再调整
在grunt-ts可以增加编译项:
emitDecoratorMetadata:true danielinbiti
0 0
- (SystemJS) Can't resolve all parameters for
- Could not resolve all dependencies for configuration ':classpath'. Could not find com.android.t
- Error: Can't resolve multiple constant drivers for net "state[31]" at traffic.vhd(36)
- idea can't resolve the symbol "servlet"
- can't resolve getServletContext();的可能解决办法
- Could not resolve all dependencies for configuration
- ERROR 1269 (HY000): Can't revoke all privileges for one or more of the requested users
- Can't resolve symbol 'Handler'和Can’t resolve method handleMessage
- quartusII综合报错(Error (10028): Can't resolve multiple constant drivers for net "txd_cnt[3]")
- Android:can't resolve symbol R in Android Studio
- IntelliJ 红色标签错误 can't resolve symbol
- 【工具】【idea】无法识别java文件(can't Resolve)
- Could not resolve all dependencies for configuration ':classpath'.
- gradle错误“Could not resolve all dependencies for configuration”
- could not resolve all dependencies for configuration ' _debugcompile 错误
- Could not resolve all dependencies for configuration ':XXX:_debugCompile'
- Could not resolve all dependencies for configuration ':classpath'.
- 【已解决】could not resolve all dependencies for configuration ':claapath'
- Java I/O 学习总结(一)
- Java I/O 学习总结(二)
- 深化Java基础之——对象与内存控制
- Java实现常见的排序算法
- 栈
- (SystemJS) Can't resolve all parameters for
- @Autowired默认规则
- 关于Office Professional Plus 2013 VOL 和Office Professional Plus 2013
- wget 无法建立ssl连接 ERROR: certificate common name “a.ssl.fastly.net”
- service的简介
- AlexNet论文翻译与解读
- 微信小程序登录页动画-云层漂浮
- jquery EasyUi combobox 控件样式修改(对当前combobox的修改)
- 网络视图gridView