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

#153 introduced compile problems with AOT #191

Closed
victornoel opened this issue Jul 26, 2017 · 10 comments
Closed

#153 introduced compile problems with AOT #191

victornoel opened this issue Jul 26, 2017 · 10 comments

Comments

@victornoel
Copy link

I'm submitting a...


[X] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request

What is the current behavior?

When compiling some projects with #153 and AOT, we get the following error:

ERROR in /home/vnoel/Linagora/Petals/dev/git/petals-cockpit/frontend/src/$$_gendir/node_modules/@ngrx/store/store.ngfactory.ts (51,65): Argument of type '{}' is not assignable to parameter of type 'StoreFeature<any, any>[]'.
Property 'includes' is missing in type '{}'.

Expected behavior:

It should compile fine :)

Minimal reproduction of the problem with instructions:

I couldn't reproduce it on a small repro, but my application is publicly available.
Clone https://gitlab.com/linagora/petals-cockpit.git, checkout 201e583230d81cd32821a32c67ffdccd1521d524, run yarn once, yarn run build

Version of affected browser(s),operating system(s), npm, node and ngrx:

node 8, ngrx nightly (7f77693, the one with #153), angular 4.1.3 and angular-cli 1.3.0-rc.0.

@Empereol
Copy link

Empereol commented Aug 8, 2017

I too am having the same error with AOT compiling.

Versions affected:

  • Node v6.11.1
  • ngrx v4.0.2
  • Angular v4.1.3
  • Angular CLI v1.2.7

@Empereol
Copy link

Empereol commented Aug 8, 2017

I swapped to Node v8.2.1 and upgraded Typescript both locally and globally to v2.4.2 and the error has gone away.

@mir4ef
Copy link

mir4ef commented Aug 9, 2017

upgrading node didn't work for me, but downgrading @ngrx/store to v4.0.0 did.

@halfmatthalfcat
Copy link

I'm running into this as well however can't downgrade to v4.0.0 because of #189. @brandonroberts any guidance on this?

@halfmatthalfcat
Copy link

halfmatthalfcat commented Aug 11, 2017

@victornoel got it working by upgrading Angular to 4.3.x

@GiuseppePiscopo
Copy link

Hi there. Just to mention we too are experiencing this error when trying to switch to AOT:

ERROR in d:/ProjectRoot/src/node_modules/@ngrx/store/store.ngfactory.ts (51,65): Argument of type '{}' is not assignable to parameter of type 'StoreFeature<any, any>[]'.
Property 'length' is missing in type '{}'.

ERROR in Error encountered resolving symbol values statically. Calling function 'TabsModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in d:/ProjectRoot/src/app/module.ts, resolving symbol AppModule in d:/ProjectRoot/src/app/module.ts

(maybe the second one is a separate thing, related to ngx-bootstrap, but those were the only errors, so posting it just in case).

I have no simple repro project to show, this is from the project we're working at. Environment:

  • ngrx 4.0.2
  • angular 4.1.1
  • rxjs 5.4.2
  • typescript 2.4.2
  • webpack 2.5.1
  • ngtools/webpack 1.4.2
  • angular/compiler-cli: 4.1.1 (we did not remove this yet)
  • node 6.6.2
  • npm 3.9.5
  • Win 10 64b

Just to specify that in the past we were not able to make AOT work with ngrx 2.x: there was an issue here here never "fixed" and now closed after the v 4.x came out.

@victornoel
Copy link
Author

victornoel commented Aug 11, 2017 via email

@halfmatthalfcat
Copy link

halfmatthalfcat commented Aug 11, 2017

Just in case it helps others, I got it working with:

  • ngrx@4.0.2
  • angular/{core,http,*}@4.3.4
  • angular/cli@1.2.4
  • rxjs@5.4.3
  • typescript@2.4.2
  • zone.js@0.8.16

@GiuseppePiscopo
Copy link

GiuseppePiscopo commented Aug 12, 2017

I got a simple repro project about this, BrainCrumbz/ngtools-webpack-demo/, where there's an empty state and a no-op reducer. All it really does related to ngrx is invoking StoreModule.forRoot(...).

As tracked in this issue, build error went away after upgrading angular (and zone.js).

@brandonroberts
Copy link
Member

I'm gonna close this issue as resolved with the latest packages mentioned above. If it can be reproduced with those packages a new issue can be opened.

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

No branches or pull requests

6 participants