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

@ngrx/data: TS-996002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class #2367

Closed
debuggerpk opened this issue Feb 11, 2020 · 9 comments · Fixed by #2387

Comments

@debuggerpk
Copy link
Contributor

Related to #2356, #2357 and #2366 . After installing from nightly builds, as @brandonroberts suggested, I started getting the error

TS-996002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class

Digging deep and looking up various issues, it appears the error is somewhat related to deep imports so i linked library from the local source using file: in my projects package.json. Doing so gave me the error below.

ERROR in Unable to write a reference to EntityDataModuleWithoutEffects

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):

Angular 9, node 12.3 on osx.

I would be willing to submit a PR to fix this issue

[x] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No

@brandonroberts
Copy link
Member

What's the fix here? I thought EntityDataModuleWithoutEffects is already being exported

@debuggerpk
Copy link
Contributor Author

@brandonroberts i am all out of ideas. have the experience of other side of the fence i.e. consuming libraries but the contributing to one.

Having said that, the closes i got to investigating this issue is angular/angular#29361 (comment) and did set

  "angularCompilerOptions": {
    "generateDeepReexports": true
  }

but still got the error. The exports appear to be right. If you can point to the documentation on how i can build this locally, i might be able to help.

@brandonroberts
Copy link
Member

There is documentation here on how to setup and build locally https://ngrx.io/contributing#setup-1

@abnemo
Copy link

abnemo commented Feb 14, 2020

Hello guys! Any udpates on this topis?
Did anybody find any workaround?

@brandonroberts
Copy link
Member

Not yet. I'll try to take a look at this soon.

@abnemo
Copy link

abnemo commented Feb 14, 2020

@brandonroberts Thank you very much. I appreciate it.

@debuggerpk debuggerpk changed the title TS-996002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class @ngrx/data: TS-996002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class Feb 14, 2020
@debuggerpk
Copy link
Contributor Author

I don't know if it might help or not, but my EntityDataModule is very customized where I do the following for imports

    EntityDataModule.forRoot(entityConfig),

and then in constructor

  constructor(entityDataService: EntityDataService, assetDataService: AssetDataService) {
    entityDataService.registerServices({ assets: assetDataService });
  }

@jonstelly
Copy link

I'm not sure if it helps anyone here but I moved all the ngrx code into angular cli generated libraries: local-ngrx-build branch on this repo and was able to build and run.

If anyone wants to try this out, hopefully you should be able to drop your app into this structure, tweak the angular.json if needed, then run (powershell):

npm i
@('store', 'effects', 'entity', 'data', 'router-store', 'store-devtools') | % { ng build "@ngrx/$_" }
ng serve

I haven't started adding back my ngrx code to that demo, but I wasn't able to even build against the packages in ngrx/data-builds, etc... That seems to suggest it's some sort of packaging issue with ngrx or how angular 9 is trying to load the ngrx modules. Maybe comparing the packages created in my repository against the ngrx official builds?

@debuggerpk
Copy link
Contributor Author

Thanks @brandonroberts

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

Successfully merging a pull request may close this issue.

4 participants