-
-
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 13: running Storybook 6.4 fails with ModuleBuildError: Module build failed #16820
Comments
Do you a have a reproduction repo you can share? If not, can you create one? See how to create a repro. Thank you! 🙏 |
Sure thing, I will do that. I already created our app skeleton with minimum code to bootstrap the app (we are using the Angular upgrade module to bootstrap AngularJS, plus we have some private NPM packages), but everything worked OK. So I will have to use the elimination method and try to remove some stuff one by one that I think might potentially create an issue. Is there a way to print more verbose logging (warning , errors)? I used the --webpack-stats-json parameter but it does not save any files in the specified folder. |
@PavelSkopik Try running with |
@shilman Thank you. Based on the stacktrace it seems to me that the issue might be Babel related. Is there a way to get more debug information about that part of the process.
|
hmm i don't know. @ndelangen ? |
I haven't seen this before.. |
I was able to narrow down the problem. When I disable the docs addon, my storybook compiles fine and opens in the browser as expected. When docs addon is enabled, the node_modules.cache\storybook\public\vendors-node_modules_prettier_parser-html_js.iframe.bundle.js contains the following code:
However, it is unclear at which point this error occurs and that is is thrown by the docs module. The I tried with the latest compodoc release. |
Does |
@lacolaco Yup, tho I have not confirmed the workaround on a project. Does it fix the problem for you? |
In my project, docs are very used, so disabling that can not be a solution for me. Logs on my environment (Angular v12.2, Storybook 6.4.8)
|
I've changed my |
@lacolaco if you remove docs for debugging purposes, does it fix the problem? |
@shilman Yes, it seems ok. I disabled docs and remove all mdx files from stories dependency and then |
I found loading If I comment out |
This line is the cause. I'm going to dig deeper. https://github.com/storybookjs/storybook/blob/v6.4.8/addons/docs/common-preset.js#L9 |
https://github.com/storybookjs/storybook/blob/main/lib/core-common/src/utils/es6Transpiler.ts#L28 @shilman I'm not sure a mechanism technically, but removing |
https://github.com/storybookjs/storybook/blob/v6.4.8/addons/docs/src/frameworks/angular/sourceDecorator.ts Prettier has separated entrypoints for UMD and ESM, however,
In my environment, I confirmed the problem can be solved by editing And I found another solution. an option for babel-loader in I confirmed it can be solved by |
@lacolaco Thanks so much for tracking this down. Any chance you can submit a PR with the change and I can review it with the team? |
@shilman Yes I can. I'll edit |
@lacolaco To be honest, I don't understand the solution yet. But please submit the PR with that change and then I can discuss with the team and test it. Thanks for moving this forward. |
I have the same issue using Storybook with Vue, when upgrading from 6.3.12 to 6.4.9. |
|
Also facing the same issue using SB with Vue. Upgrading from 6.1 to 6.4 |
@shilman @ndelangen we are quite lot of people facing this issue, would be nice with a response :) |
@JohnCasab I have a fix for this for us locally, while this gets fixed on the Storybook side. Lock your prettier version to If you are using Yarn, you can use selective dependency resolution. E.g. {
"resolutions": {
"prettier": "2.3.0"
}
} |
This worked for our vue storybook, thank you @prashantpalikhe!
|
Whoopee!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.0-alpha.17 containing PR #17239 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
w00t!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.13 containing PR #17239 that references this issue. Upgrade today to the
|
Describe the bug
I upgraded from Storybook 6.3.2 to 6.4.0
When running Storybook 6.4 together with Angular 13 the Storybook build fails with the following error:
System
Environment Info:
System:
OS: Windows 10 10.0.19043
CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
Binaries:
Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.21.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 8.1.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 96.0.4664.45
Edge: Spartan (44.19041.1266.0), Chromium (96.0.1054.34)
npmPackages:
@storybook/addon-a11y: 6.4.0 => 6.4.0
@storybook/addon-actions: 6.4.0 => 6.4.0
@storybook/addon-controls: 6.4.0 => 6.4.0
@storybook/addon-docs: 6.4.0 => 6.4.0
@storybook/addon-essentials: 6.4.0 => 6.4.0
@storybook/addon-storysource: 6.4.0 => 6.4.0
@storybook/addon-viewport: 6.4.0 => 6.4.0
@storybook/angular: 6.4.0 => 6.4.0
@storybook/builder-webpack5: ^6.4.0 => 6.4.0
@storybook/manager-webpack5: ^6.4.0 => 6.4.0
Angular CLI: 13.0.3
Node: 16.13.0
Package Manager: yarn 1.21.1
OS: win32 x64
Angular: 13.0.2
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router, upgrade
Package Version
@angular-devkit/architect 0.1300.3
@angular-devkit/build-angular 13.0.3
@angular-devkit/core 13.0.3
@angular-devkit/schematics 13.0.3
@angular/cli 13.0.3
@schematics/angular 13.0.3
rxjs 7.4.0
typescript 4.4.4
I use Storybook with Compodoc and have Eslint for TypeScript in place.
Please let me know if I can provide any more information.
The text was updated successfully, but these errors were encountered: