-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Bug]: Angular APP_INITIALIZER not firing in 7.0.0-beta.48 #21121
Comments
Maybe related, I've been having issues with Angular and the v7 beta (tried 7.0.0-beta.43 & 7.0.0-beta.49) where it doesn't seem to initialize modules that are imported using // my-module.ts
@NgModule({})
export class MyModule {
constructor() {
console.log('never called');
}
}
// preview.ts
export const decorators = [
moduleMetadata({
imports: [MyModule],
})
]; |
Crikey!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-beta.52 containing PR #21059 that references this issue. Upgrade today to the
|
The APP_INITIALIZER is now called when its defined in the story component itself, but when its defined in a module and this module is referenced in moduleMetadata, the APP_INITIALIZER is not called.
TranslateModule.forRoot() does not seem to provide the TranslateService to my application. The TranslateService is used by some other service dependencies and I always get a |
@AE1NS have you tried global decorators? // .storybook/preview.ts
import { Decorator, moduleMetadata } from '@storybook/angular';
export const decorators: Decorator[] = [
moduleMetadata({
imports: [...],
providers: [...],
}),
]; (I've updated to beta 53, and briefly tried using |
Thats exactly what I was looking for, thank you! Unfortunately I still have the issue here with missing environment providers. As already described, when I import
|
Also running into this issue in |
@valentinpalkovic do you want me to open a new ticket, or will you reopen this one? |
@AE1NS Yes please :) |
Describe the bug
When using storybook 7.0.0-beta.48 in angular, the APP_INITIALIZER function is not called before the application is loaded. It seems just to be ignored.
To Reproduce
No response
System
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: