[英]Cannot import UpgradeModule from @angular\upgrade\static Angular V2.2.1
I'm currently upgrading my AngularJS (ng1) app to Angular 2 (ng2). 我目前正在将AngularJS(ng1)应用程序升级到Angular 2(ng2)。
I'm using Angular version 2.2.1. 我正在使用Angular 2.2.1版本。
When I'm importing UpgradeModule from @angular\\upgrade\\static I get the following exception: Uncaught SyntaxError: Unexpected reserved word
Uncaught ReferenceError: webpackJsnop is not defined
当我从@angular \\ upgrade \\ static导入UpgradeModule时,出现以下异常: Uncaught SyntaxError: Unexpected reserved word
Uncaught ReferenceError: webpackJsnop is not defined
I'm using WebPack V1.13.1. 我正在使用WebPack V1.13.1。
When I'm using the upgrade_adapter way I need to add the @Inject annotation. 当我使用upgrade_adapter方法时,我需要添加@Inject批注。
Thanks for the Help. 谢谢您的帮助。
This might be an Angular bug. 这可能是一个Angular错误。 You can have a temporal fix just to test what you are doing by deleting this file: 您可以通过删除此文件来临时修复一下您正在做的事情:
node_modules/@angular/upgrade/static.js node_modules/@angular/upgrade/static.js
What is going on is that webpack is prioritizing the file below and that is why it is throwing that exception: 这是因为webpack正在优先处理以下文件,这就是为什么它会引发该异常的原因:
node_modules/@angular/upgrade/static/package.json node_modules/@angular/upgrade/static/package.json
I wanted to leave this under comments, but I did not have the enough reputation to leave it there. 我想对此置评,但我没有足够的声誉将其保留。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.