-
-
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
Angular always devMode enabled when using build-storybook #16211
Comments
I'm not certain if the issue that I am experiencing is related. However, I get the The project is an Angular library built for production on AWS CodeBuild. When the library was on Angular 11.2.14 and Storybook 6.1.21, we did not receive any such errors in any browser. After upgrading to Angular 12.2.11 and Storybook 6.3.12, we noticed that Firefox and Safari would generate the above error in the browser console once for each page visited. Subsequent visits would not generate the error. Is this a known issue? Is there something that I can do to correct the issue in either the Angular project or the Storybook configuration? Affected Browsers: Build Environment: Snippet of Dev Dependencies:
|
Looks like storybook runs in devMode. But you can also enable prod mode in preview.js:
I'm using Angular14 + Storybook 6.5.10 |
We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if:
|
Describe the bug
When using the angular.json @storybook/angular/build-storybook builder, prod mode is not used like I would expect.
To Reproduce
This Repo
npm run build-storybook
works as expected, prod mode is not used in Angular stories. (tested withnpx serve ./storybook-static
)npm run build-storybook-builder
runs Angular stories in dev mode (notice that it is logged in the console when stories are first loaded )System
Environment Info:
System:
OS: macOS 11.6
CPU: (12) x64 Intel(R) Xeon(R) CPU E5-1650 v2 @ 3.50GHz
Binaries:
Node: 16.6.1 - ~/.nvm/versions/node/v16.6.1/bin/node
Yarn: 3.0.1 - /usr/local/bin/yarn
npm: 7.20.3 - ~/.nvm/versions/node/v16.6.1/bin/npm
Browsers:
Chrome: 94.0.4606.61
Firefox: 92.0.1
Safari: 15.0
npmPackages:
@storybook/addon-actions: ^6.4.0-beta.3 => 6.4.0-beta.3
@storybook/addon-docs: ^6.4.0-beta.3 => 6.4.0-beta.3
@storybook/addon-essentials: ^6.4.0-beta.3 => 6.4.0-beta.3
@storybook/addon-links: ^6.4.0-beta.3 => 6.4.0-beta.3
@storybook/angular: ^6.4.0-beta.3 => 6.4.0-beta.3
@storybook/builder-webpack5: ^6.4.0-beta.3 => 6.4.0-beta.3
@storybook/manager-webpack5: ^6.4.0-beta.3 => 6.4.0-beta.3
Additional context
When running
build-storybook
from the sb command line, this error is output:Which makes me question if it is intentional to enable prod mode when building the static storybook, or a "happy accident".
Angular Dev mode causes change detection to be run twice every time it would normally be run once. There are other things that are enabled that make dev mode slower/larger.
I see this issue in 6.3.x also
The text was updated successfully, but these errors were encountered: