angular-university / ngrx-course-v4

Contains the NgRx Store and Reactive Extensions Course
https://angular-university.io
150 stars 119 forks source link

app not working #7

Closed yaronmil closed 7 years ago

yaronmil commented 7 years ago

running the lates version (master) yield the folling error :

ERROR in Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function (position 12:42 in the original .ts file), resolving symbol compose in D:/vasco/ngrx-c ourse/node_modules/@ngrx/core/compose.d.ts, resolving symbol AppModule in D:/vasco/ngrx-course/src/app/app.module.ts, resolving symbol AppModule in D:/vasco/ngrx-course/src/app/app.module.ts, resolving symbol AppModule in D:/vasco/ngrx-course/src/app/app.module.ts, resolving symbol AppModule in D:/vasco/ngrx-course/src/app/app.module.ts, resolving symbol AppModule in D:/vasco/ngrx-course/src/app/app.module.ts

ERROR in ./src/main.ts Module build failed: TypeError: Cannot read property 'newLine' of undefined at Object.getNewLineCharacter (D:\vasco\ngrx-course\node_modules\typescript\lib\typescript.js:9514:20) at Object.createCompilerHost (D:\vasco\ngrx-course\node_modules\typescript\lib\typescript.js:63770:26) at Object.ngcLoader (D:\vasco\ngrx-course\node_modules\@ngtools\webpack\src\loader.js:338:33) @ multi webpack-dev-server/client?http://localhost:4201 ./src/main.ts

ERROR in ./src/polyfills.ts Module build failed: TypeError: Cannot read property 'newLine' of undefined at Object.getNewLineCharacter (D:\vasco\ngrx-course\node_modules\typescript\lib\typescript.js:9514:20) at Object.createCompilerHost (D:\vasco\ngrx-course\node_modules\typescript\lib\typescript.js:63770:26) at Object.ngcLoader (D:\vasco\ngrx-course\node_modules\@ngtools\webpack\src\loader.js:338:33) @ multi ./src/polyfills.ts webpack: Failed to compile.

ZikZakJainy commented 7 years ago

I am also facing same error.

daiando commented 7 years ago

I got same error.

JimmyOnGitHub commented 7 years ago

This is ridiculous ,why hasn't this been addressed?

jhades commented 7 years ago

Hello everyone, this looks like an issue in the CLI or in the toolchain that uses it. If we hit space in a typescript file that triggers a rebuild of the same program, but this time it works, even if we didn't change the program.

jhades commented 7 years ago

The following was put in place to improve the situation: the definition of the reducer was put outside the module file, into an external file. This still throws the error message but the application now runs.

This issue will eventually disappear as the CLI evolves, if anyone is still facing this issue I advise updating the CLI. KR Vasco

hairylee commented 7 years ago

Hi,

I found a little workaround to get rid of the error message.

in app.module.ts add: export function getComposedReducers(state: any, action: any) { return reducer(state, action); }

in app.module.ts use the new Function instead of the compose constant: ... StoreModule.provideStore(getComposedReducers, INITIAL_APPLICATION_STATE), ...