简体   繁体   English

无法从@angular \\ upgrade \\ static Angular V2.2.1导入UpgradeModule

[英]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.

相关问题 使用 UpgradeModule 从 AngularJS 1.5 升级到 Angular 5 时出错 - Error when using UpgradeModule upgrading from AngularJS 1.5 to Angular 5 带有 UpgradeModule 的 Angular 6 无法解析 ApplicaitonModule 的所有参数 - Angular 6 with UpgradeModule cant resolve all parameters for ApplicaitonModule 当使用“UpgradeModule”降级服务进行单元测试时,Angular 2:“Unknown Provider:$$ angularInjectorProvider” - Angular 2: “Unknown Provider: $$angularInjectorProvider” when unit testing with an `UpgradeModule` downgraded service 将指令从 angular js 升级到 angular 8 - Upgrade directive from angular js to angular 8 将角流星项目(v1.2.1)升级到流星1.3 - Upgrade angular-meteor project (v1.2.1) to Meteor 1.3 如何导入角度升级适配器以获取混合应用程序? - How to import the angular upgrade adapter to get a hybrid application? 从 'angular' 导入 {angular} 在 AngularJS(1.5) 中不起作用 - import {angular} from 'angular' is not working in AngularJS(1.5) 角度从1.6.6升级到6的$ Injector错误 - $Injector Error on Angular Upgrade from 1.6.6 to 6 从2.1.1将angular2升级到2.4.1版本 - Upgrade angular2 to version 2.4.1 from 2.1.1 角度升级 - 如何从Angular模板导航到Angularjs中定义的状态? - Angular upgrade - How to navigate to a state defined in Angularjs from Angular template?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM