-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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/store v11 throws a compilation error #2919
Comments
Do you have a reproduction of this @matheo ? |
@timdeschryver Unfortunately nope, and my lerna setup is hard to reproduce. |
We faces the same issue while updating Angular and NgRx to 11.
|
it was me who opened the stackoverflow thread. because I didn't want to spam your repo with an issue I am pretty much sure is my fault :) |
so, I've done some investigation. as already mentioned on Stackoverflow I've tracked the issue down to the
import { ModuleWithProviders, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { StoreModule } from '@ngrx/store';
import { EffectsModule } from '@ngrx/effects';
import { reducers } from './reducers';
export const COMPONENTS = [
/* a, b */
];
@NgModule({
imports: [/* ... , */ CommonModule, ReactiveFormsModule],
declarations: COMPONENTS,
exports: COMPONENTS
})
export class AModule {
static forRoot(): ModuleWithProviders<RootAModule> {
return {
ngModule: RootAModule,
providers: [
/* ... */
]
};
}
}
@NgModule({
imports: [
AModule,
StoreModule.forFeature('a', reducers),
EffectsModule.forFeature([
/* ... */
])
]
})
export class RootAModule {}
export interface AStateData {
a: fromA.aType;
b: fromB.bType;
}
export const reducers = {
a: fromA.a,
b: fromB.b
};
// fromA
export function a(state = initialState, action: a.Actions): aType { ... }
// fromB
export function b(state = initialState, action: b.Actions): bType { ... } versions and build results,
An unhandled exception occurred: Error during template compile of 'RootAModule'
Function calls are not supported in decorators but 'StoreModule' was called.
Unexpected value 'undefined' imported by the module 'RootAModule in ...'
Error during template compile of 'AModule'
Function calls are not supported in decorators but 'StoreModule' was called. An unhandled exception occurred: @ngrx/store/ngrx-store.ts(224,21): Error during template compile of 'StoreModule'
Expression form not supported.
@ngrx/store/ngrx-store.ts(231,15): Error during template compile of 'StoreModule'
Expression form not supported.
@ngrx/store/ngrx-store.ts(257,13): Error during template compile of 'StoreModule'
Expression form not supported.
@ngrx/store/ngrx-store.ts(224,21): Error during template compile of 'StoreModule'
Expression form not supported.
@ngrx/store/ngrx-store.ts(231,15): Error during template compile of 'StoreModule'
Expression form not supported.
@ngrx/store/ngrx-store.ts(257,13): Error during template compile of 'StoreModule'
Expression form not supported.
I will take a look at the diffs now. maybe I can find something. Edit 1: Maybe I will try creating a reproducible example based on our source. let's see what I can do. |
@timdeschryver there you go: https://github.com/bbortt/ngrx-store-module-reproducible |
I can reproduce this with another project and can confirm that this error was not appearing in 11.0.0-beta.1 . After upgrading to 11.0.0 the build is failing. |
Thanks for the reproduction @bbortt |
I'm going to bet it's probably this one, as it's the only changes made to StoreModule.forFeature |
@brandonroberts I got a fix, I'm just validating it works against the reproduction @bbortt provided |
👍🏿 |
@timdeschryver I can approve it. many thanks. |
@timdeschryver the fix is still unreleased :-? |
saw that too this morning. any chance to get |
@matheo the fix will be in v 11.0.1 |
Today I've updated
@ngrx
v11 and I got a broken library-build with this error message(reverting to `v10 goes back to normal):
Versions of NgRx, Angular, Node, affected browser(s):
I would be willing to submit a PR to fix this issue
[ ] Yes (Assistance is provided if you need help submitting a pull request)
[x] No
The text was updated successfully, but these errors were encountered: