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

ng update errors have no line numbers #2093

Closed
pcurrivan opened this issue Aug 27, 2019 · 2 comments · Fixed by #2095
Closed

ng update errors have no line numbers #2093

pcurrivan opened this issue Aug 27, 2019 · 2 comments · Fixed by #2095
Labels

Comments

@pcurrivan
Copy link

Currently an error during automatic migration looks like this:

** Executing migrations for package '@ngrx/store' **
Cannot read property 'filter' of undefined

Not very helpful. It should be more like this error message from @angular/core:

** Executing migrations for package '@angular/core' **
        ------ Static Query Migration ------
        With Angular version 8, developers need to
        explicitly specify the timing of ViewChild and
        ContentChild queries. Read more about this here:
        https://v8.angular.io/guide/static-query-migration
        
        The template migration strategy uses the Angular compiler internally and therefore projects that no longer build successfully after the update cannot use the template migration strategy. Please ensure there are no AOT compilation errors.
        
        Could not setup migration strategy for "src/tsconfig.app.json". The following error has been reported:
        
        Error: error TS100: Error during template compile of 'AppModule'
          Function expressions are not supported in decorators in 'ɵ0'
            'ɵ0' contains the error at src/app/app.module.ts(29,21)
              Consider changing the function expression into an exported function.
        
        
        Migration can be rerun with: "ng update @angular/core --from 7 --to 8 --migrate-only"
        
        ------------------------------------------------
@timdeschryver
Copy link
Member

It's a different error, the Angular error is an error on "your side" that you can fix to be able to run the migration correctly.

The Cannot read property 'filter' of undefined is a problem on "our side", and I believe I found the culprit.

Do you import the store somewhere in your project as follows

import * as store from '@ngrx/store';

If so, you can fix this issue by import the store imports via named imports until we release a fix, for example:

import { StoreModule } from '@ngrx/store';

@pcurrivan
Copy link
Author

@timdeschryver You are correct. I have such an import statement. I'm glad you found the source of the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants