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

Error encountered resolving symbol values statically when calling 'createFeatureSelector' #611

Closed
duartealexf opened this issue Nov 29, 2017 · 4 comments

Comments

@duartealexf
Copy link

I'm submitting a...


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

What is the current behavior?

Running into "Error encountered resolving symbol values statically" error when calling function "createFeatureSelector", when building with: ng serve --host 0.0.0.0 --disable-host-check --vendor-chunk --extract-css true --aot.

Without the --aot flag it builds fine.

Expected behavior:

It should build using the --aot flag.

Minimal reproduction of the problem with instructions:

  1. Clone my repository @ https://github.com/duartealexf/web-labs
  2. Run docker-compose build then docker-compose up (which will run the 'ng build' command mentioned, with --aot).

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

node v8.7.0
npm v5.4.2
yarn v1.2.0
ngrx 4.1.1
browser: N/A
OS: macOS High Sierra 10.13.1

Other information:

Here's a print of the situation:
captura de tela 2017-11-28 as 23 59 07

I really don't know why this error suddenly started happening. I tried to redeclare a copy of the function locally, but since i need to import the createFeatureSelector to do so, i went back to square one. I really need to know if this is at least happening to other people or if my mac is trying to drive me nuts!

Thanks everyone.

@brandonroberts
Copy link
Member

@duartealexf
Copy link
Author

Okay I fixed it like you said and now everything works! Thanks!

However... i get this error after building successfully:

image

A very similar message is also shown in the example-app for me, but there it does compile and does not indicate an error.

If I hover the red underline the same message is shown:

image

Is there a way to fix this? Thank you again.

@duartealexf
Copy link
Author

Hi @brandonroberts, I've seen a lot of issues in StackOverflow and in this repo about this is not assignable to type error.

When I build my project (I sent you before) using ng serve --host 0.0.0.0 --disable-host-check --vendor-chunk --extract-css true --aot it compiles successfully, it works in Chrome, but VSCode and the compiler still complain about the incompatibility. (Images above).

Now I built the platform/example-app from this repo and VSCode complains about type incompatibility as well. But when I build it using -prod or --vendor-chunk --extract-css true --aot the compiler does not complain. What is the secret?

This is platform/example-app:

image

and the message is:

Type '{ layout: (state: State | undefined, action: LayoutActions) => State; router: <T = RouterStateSna...' is not assignable to type 'ActionReducerMap<State, Action>'.
  Types of property 'layout' are incompatible.
    Type '(state: State | undefined, action: LayoutActions) => State' is not assignable to type 'ActionReducer<State, Action>'.
      Types of parameters 'action' and 'action' are incompatible.
        Type 'Action' is not assignable to type 'LayoutActions'.
          Type 'Action' is not assignable to type 'CloseSidenav'.
            Types of property 'type' are incompatible.
              Type 'string' is not assignable to type 'LayoutActionTypes.CloseSidenav'.

While the red underline in line 49 has this message:

Type '(state: State, action: any) => State' is not assignable to type 'ActionReducer<State, Action>'.
  Types of parameters 'state' and 'state' are incompatible.
    Type 'State | undefined' is not assignable to type 'State'.
      Type 'undefined' is not assignable to type 'State'.

Can you help me understand what is going on here? How do we get rid of these messages? How to build without the compiler complaining about this type mismatch?
Thank you.

@zmnv
Copy link

zmnv commented Oct 17, 2018

still same "error" ... typescript ~2.8.4 / 3.1.1 ...

just download that repository and go to example-app folder
platform\projects\example-app\src\app\reducers\index.ts

image

image

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

3 participants