Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to upgrade to 4.0.0-rc.1 #14795

Closed
julianobrasil opened this issue Feb 28, 2017 · 19 comments
Closed

Fail to upgrade to 4.0.0-rc.1 #14795

julianobrasil opened this issue Feb 28, 2017 · 19 comments

Comments

@julianobrasil
Copy link

julianobrasil commented Feb 28, 2017

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[x] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
Just tried to execute the suggested command line to upgrade Angular:
npm install @angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}@next --save

I brings up the following error message (translated from portuguese):

At line:1 character:29
+ npm install @angular/{common,compiler,compiler-cli,core,forms,http,pl ...
+                             ~
Missing argument in the parameters list.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingArgument

Expected behavior
Angular upgrade to 4.0.0-rc.1

Minimal reproduction of the problem with instructions
npm install @angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}@next --save

What is the motivation / use case for changing the behavior?
Try out 4.0.0-rc.1 in a existing project

Please tell us about your environment:
@angular/cli: 1.0.0-rc.0
node: 6.9.5
os: win32 x64
@angular/cli: 1.0.0-rc.0
@angular/common: 2.4.8
@angular/compiler: 2.4.8
@angular/core: 2.4.8
@angular/flex-layout: 2.0.0-rc.1
@angular/forms: 2.4.8
@angular/http: 2.4.8
@angular/material: 2.0.0-beta.2
@angular/platform-browser: 2.4.8
@angular/platform-browser-dynamic: 2.4.8
@angular/router: 3.4.8
@angular/compiler-cli: 2.4.8

  • Angular version: 2.4.8 (angular core)
  • Browser: not a browser issue

  • Language: Typescript 2.3.0-dev.20170228

  • Node (for AoT issues): node --version = 6.9.5

@DzmitryShylovich
Copy link
Contributor

DzmitryShylovich commented Feb 28, 2017

Just add in your package.json:

"dependencies": {
    "@angular/common": ">=4.0.0-beta <5.0.0",
    "@angular/compiler": ">=4.0.0-beta <5.0.0",
    "@angular/core": ">=4.0.0-beta <5.0.0",
    "@angular/forms": ">=4.0.0-beta <5.0.0",
    "@angular/http": ">=4.0.0-beta <5.0.0",
    "@angular/platform-browser": ">=4.0.0-beta <5.0.0",
    "@angular/platform-browser-dynamic": ">=4.0.0-beta <5.0.0",
    "@angular/router": ">=4.0.0-beta <5.0.0",
    "core-js": "^2.4.1",
    "rxjs": "^5.1.0",
    "zone.js": "^0.7.6"
  },

@julianobrasil
Copy link
Author

julianobrasil commented Feb 28, 2017

@DzmitryShylovich I updated my dependencies. It worked. Now the compiler is complaining about NgControl. Aparently something changed about it. Was it deprecated or replaced with something else?

@julianobrasil
Copy link
Author

julianobrasil commented Feb 28, 2017

My mistake. It was just a wrong import statement. But now I see a lot of messages like "ERROR in ./src/$$_gendir/app/app.component.ngfactory.ts". I'm gonna check them out.

@julianobrasil
Copy link
Author

The first compile error is different from the others (see bellow: it's a router_config_loader error). From the second error and on, they are all similar, just changing the package part (core, common etc).

ERROR in Could not resolve module @angular/router/src/router_config_loader

ERROR in ./src/$$_gendir/app/app.module.ngfactory.ts
Module not found: Error: Can't resolve '../../../@angular/core' in 'E:\xxxxx\src\$$_gendir\app'
 @ ./src/$$_gendir/app/app.module.ngfactory.ts 12:0-50
 @ ./src/main.ts
 @ multi ./src/main.ts

@ghost
Copy link

ghost commented Feb 28, 2017

@julianobrasil got the same problem Could not resolve module @angular/router/src/router_config_loader
Did you resolve the issue?

@aitboudad
Copy link
Contributor

angular now use Flat ES Modules which means using @angular/router/src/router_config_loader path is not possible anymore

Before:

import { ROUTES } from "@angular/router/src/router_config_loader";

After:

import { ROUTES } from "@angular/router";

@julianobrasil
Copy link
Author

julianobrasil commented Feb 28, 2017

@BaconLord Nop. I saw this other issue #14513 that shows an error message pointing to problems relating to ngfactory.ts, but found nothing about this particular issue.

@aitboudad so it is an issue concerning the compiler? I don't have any import like @angular/router/src/router_config_loader.

@aitboudad
Copy link
Contributor

@julianobrasil check your third-party dependencies, for example ui-router-ng2

@DuncanLewis
Copy link

DuncanLewis commented Feb 28, 2017

@aitboudad @julianobrasil Try disabling MaterialModule, just disabled it and worked again for me.

Edit: It was disabling HammerJS, not MaterialModule that solved the issue.

@julianobrasil
Copy link
Author

julianobrasil commented Feb 28, 2017

@aitboudad, unfortunatly my project is almost 100% using angular.io technologies (Angular + Angular Material 2).

The 'almost' is because I use ng2-pagination, but so far as I know it doesn't use any routing feature.

@julianobrasil
Copy link
Author

julianobrasil commented Feb 28, 2017

@DuncanLewis Tried it here, but still got the error. I'll try disabling material after lunch.

Edit: Actually I reallize that disabling Material over here isn't so quick. I have at least 20 files using mdsnackbar (more than once in each file) that would miss the absence of Material. I'll wait for some other fix (if, of course, it's really a bug).

@Delagen
Copy link
Contributor

Delagen commented Feb 28, 2017

@julianobrasil if you use thirdparty libraries even from author of framework you often cannot to upgrade core to latest version because of dependent library does not updated synchronously. So read docs, changelogs (breaking changes parts read two times), and of cause source as the one source of truth. And simply wait for dependent library be ready for new version of core

@julianobrasil
Copy link
Author

@Delagen you're right. This is the case with angular and material (same umbrella project, but not at the same point in evolution). I'm gonna wait for the material team (not blaming material for the problem, but there are material error messages related to it's use of ).

@intellix
Copy link

intellix commented Feb 28, 2017

Was wondering where this was coming from. I did a grep inside my project and the only instance of router_config_loader was inside angular/compiler-cli:

node_modules/@angular/compiler-cli/src/ngtools_impl.js:var ROUTER_MODULE_PATH = '@angular/router/src/router_config_loader';

Edit: Yep, I have an old compiler-cli

@aitboudad
Copy link
Contributor

aitboudad commented Feb 28, 2017

you should make sure to update @angular/compiler-cli too in your package.json as the latest version
contains

ROUTER_MODULE_PATH = '@angular/router';

@robwormald
Copy link
Contributor

@Delagen that's what we're explicitly trying to avoid, actually. There should not be breakages from existing component libraries from 2.4.x when upgrading to 4.0.

The original issue here appears to be resolved. Please open a new issue if you can narrow it down to a specific bug.

@julianobrasil
Copy link
Author

julianobrasil commented Feb 28, 2017

Opened new issue #14817 with the same title.

@Delagen
Copy link
Contributor

Delagen commented Mar 1, 2017

@robwormald As someone said at angular 2 final launch event "we will try to not break the code more than once every 6 months" (or something similar, cannot find video :sad: )
Product cannot evolve without breaking changes. So it's normal that major upgrade will break your code. But upgrade process must be simple if you read changelogs and follow product guidelines.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants