ngrx / platform

Reactive State for Angular
https://ngrx.io
Other
8.03k stars 1.97k forks source link

Ng15 upgrade, Store-Devtools issue #3806

Closed spock123 closed 1 year ago

spock123 commented 1 year ago

Which @ngrx/* package(s) are the source of the bug?

store-devtools

Minimal reproduction of the bug/regression with instructions

After upgrading to Angular v15 (and ngrx store 15) I get this error when adding StoreDevtoolsModule:

import { StoreDevtoolsModule } from '@ngrx/store-devtools';

@NgModule({
  imports: [
    CommonModule,
    StoreModule.forRoot(coreReducer),
    environment.production ? StoreDevtoolsModule.instrument() : []
  ]
})

Gives:

Error: ../../node_modules/.pnpm/@ngrx+store-devtools@15.4.0_pk7io4fih6nsp6urmver43nfnq/node_modules/@ngrx/store-devtools/src/provide-store-devtools.d.ts:1:10 - error TS2305: Module '"@angular/core"' has no exported member 'EnvironmentProviders'.

1 import { EnvironmentProviders, InjectionToken } from '@angular/core';
       ~~~~~~~~~~~~~~~~~~~~

Note; I am using pnpm in a monorepo setup.

Minimal reproduction of the bug/regression with instructions

Expected not to be an error. It worked fine on v14x

Thanks

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

Ngrx 15.4.0
Angular 15.2.3

Other information

Angular CLI: 15.2.4
Node: 18.12.1
Package Manager: pnpm 7.27.0
OS: darwin arm64

Angular: 15.2.3
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, localize, material, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1502.4 (cli-only)
@angular-devkit/build-angular   15.2.4
@angular-devkit/core            15.2.4 (cli-only)
@angular-devkit/schematics      15.2.4 (cli-only)
@angular/cli                    15.2.4
@angular/fire                   7.5.0
@nguniversal/builders           15.2.0
@nguniversal/express-engine     15.2.0
@schematics/angular             15.2.4 (cli-only)
rxjs                            7.5.7
typescript                      4.9.5

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

timdeschryver commented 1 year ago

Hi have you tried clearing your node_modules and running a clean install?

spock123 commented 1 year ago

@timdeschryver yes, unfortunately this did not resolve my issue. My colleage had the same issue on his laptop (same code base though). The strange thing is that it worked fine in Ng14

spock123 commented 1 year ago

I'll just close this for now as I'm convinced it's the pnpm monorepo that is fcking with me /s