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

[Bug]: Angular APP_INITIALIZER not firing at Storybook 8 #29386

Open
gogumachu opened this issue Oct 17, 2024 · 0 comments
Open

[Bug]: Angular APP_INITIALIZER not firing at Storybook 8 #29386

gogumachu opened this issue Oct 17, 2024 · 0 comments

Comments

@gogumachu
Copy link

Describe the bug

When using storybook 8 version in angular, the APP_INITIALZER dosen't work.

The problem looks the same as the issue before.

I tried to correct it by referring to what was on this link, but it still doesn't run.

I modified 'preview.ts' as below in this stackblitz project, but it doesn't work.

const preview: Preview = {
  parameters: {
    actions: { argTypesRegex: '^on[A-Z].*' },
    controls: {
      matchers: {
        color: /(background|color)$/i,
        date: /Date$/i,
      },
    },
  },
  decorators: [
    moduleMetadata({
      providers: [
        {
          provide: APP_INITIALIZER,
          useFactory: () => {
            console.log('APP_INITIALIZER!!!!');
          },
          multi: true,
        },
      ],
    }),
  ],
};

export default preview;

Reproduction link

https://stackblitz.com/edit/github-rkffss-81zfge

Reproduction steps

  1. Go here https://stackblitz.com/edit/github-rkffss-81zfge
  2. and modify preview.ts
const preview: Preview = {
  parameters: {
    actions: { argTypesRegex: '^on[A-Z].*' },
    controls: {
      matchers: {
        color: /(background|color)$/i,
        date: /Date$/i,
      },
    },
  },
  decorators: [
    moduleMetadata({
      providers: [
        {
          provide: APP_INITIALIZER,
          useFactory: () => {
            console.log('APP_INITIALIZER!!!!');
          },
          multi: true,
        },
      ],
    }),
  ],
};

export default preview;
  1. I can't see the APP_INITIALIZER!!!! log

System

storybook@8.3.5

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants