-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Large Angular component initialization not complete when story_store applyLoaders promise resolves #14905
Comments
Can you please create a reproduction by running |
@shilman I have isolated it down to the syntax for defining the ngrx ROOT_REDUCERS token. The error in the alpha release is different but is still broken. All three ways for defining the ActionReducerMap work with the angular application, but using the This definition of the reducers works in the application and the storybook.
This definition of the reducers works in the application, but not in storybook. There is a case 2 where I create the factory function and specify a provider that uses the factory function in the module.
Here is the repo with example built using your project scaffolding |
@shilman Here are the
I am starting to question if the errors are related between 6.2.9 and 6.3.0-alpha.36. The only good news is with 6.3.0-alpha.36 I get consistent pass/fail behavior. |
@shilman I have tested this issue against 6.3.0-beta.8 and case 2 and 3 from the repro sample still fail. |
@shilman From our application using release candidate. OUR APPLICATION Environment Info: System: REPRO PROJECT Environment Info: System: |
Describe the bug
My best guess is that larger Angular component stories or components that rely on large external libraries, for example our common map control is a large component and depends on the google javascript mapping API, aren't completely constructed when the promise from the applyLoaders() method in the story_store resolves. I have seen strange typescript transpilation of async/await in my code before...
If one of the larger component stories is the first loaded, usually from a deep link to the story, all subsequent stories are broken and you can't get storybook back to a running state without reloading from the base URL or a small story URL.
There is a console error thrown from the StorybookWrapper stating
provider.ngAfterViewInit is not a function
when a larger component story is the first story loaded.If I add a check in core.js for undefined on provider functions I can get everything loaded correctly.
If this same larger component story is the second story loaded, navigated to after a smaller component story loads without error, then the larger story will also load without error, and all subsequent stories without error.
To Reproduce
I tried to pull your repo and introduce a larger component user story but ran into issues with puppeteer on WSL2 and also out of time to try and setup a PR with an example. Was thinking about using the google map from the angular material components library.
System
Environment Info:
System:
OS: Linux 5.4 Ubuntu 20.04.2 LTS (Focal Fossa)
CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Binaries:
Node: 12.21.0 - ~/.nvm/versions/node/v12.21.0/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v12.21.0/bin/yarn
npm: 6.14.11 - ~/.nvm/versions/node/v12.21.0/bin/npm
Browsers:
Chrome: 90.0.4430.212
npmPackages:
@storybook/addon-a11y: ^6.2.9 => 6.2.9
@storybook/addon-essentials: ^6.2.9 => 6.2.9
@storybook/addon-storysource: ^6.2.9 => 6.2.9
@storybook/angular: ^6.2.9 => 6.2.9
Additional context
Not sure if this is related to issue Storybook 6.2.0-beta new angular renderer ovverides properties
The text was updated successfully, but these errors were encountered: