Storybook: Storybook v5.3.19 build hangs after upgrading to Angular v10.0.9

Created on 18 Aug 2020  路  2Comments  路  Source: storybookjs/storybook

Describe the bug
Storybook v5.3.19 build hangs on random files within the 19% to 21% range after upgrading Angular 9 project to Angular 10.

info @storybook/angular v5.3.19
info
info => Loading static files from: ...
info => Loading presets
info => Loading presets
info => Loading custom manager config.
info => Loading config/preview file in "./.storybook".
info => Found custom tsconfig.json
info => Using default Webpack setup.
info => Using angular project '...' for configuring Storybook.
info => Loading angular-cli config.
info => Get angular-cli webpack config.
Starting type checking service...
Using 1 worker with 2048MB memory limit
20% building 87/109 modules 22 active ...node_modulesairbnb-js-shimstargetes2016.js

Just hangs at that 20% completion status and doesn't move after an hour or more.
Tried running the build multiple times, and it hangs on random files and between %19 to 21% completion.

To Reproduce
Steps to reproduce the behavior:

  1. Upgraded our Angular v9 library and Angular app to Angular v10.
  2. Cleaned node_modules and dist folders.
  3. Rebuilt Angular lib and app. Both Angular library and app work fine.
  4. Run start-storybook.
  5. Build hangs on random files in the 19% to 21% completion range as shown in the log output above.

Expected behavior
Storybook build should complete and serve Storybook web site.

Screenshots
N/A

Code snippets
N/A

System:

OS: Windows 10 10.0.17763
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz

Binaries:
Node: 10.22.0 - C:Program Filesnodejsnode.EXE
npm: 6.14.6 - C:Program Filesnodejsnpm.CMD
Browsers:
Chrome: 84.0.4147.125
Edge: Spartan (44.17763.831.0)
npmPackages:
@storybook/addon-actions: ~5.3.19 => 5.3.19
@storybook/addon-knobs: ~5.3.19 => 5.3.19
@storybook/addon-links: ~5.3.19 => 5.3.19
@storybook/addon-notes: ~5.3.19 => 5.3.19
@storybook/addons: ~5.3.19 => 5.3.19
@storybook/angular: ~5.3.19 => 5.3.19

Additional context
Had to increase max memory for node usage for our app after upgrading to Angular 10. Tried increasing node's max memory before running start-storybook, but that did not help.

Requesting any help with troubleshooting this issue.

angular help wanted question / support

Most helpful comment

Just in case someone else encounters the Storybook build hanging after upgrading to Angular 10, the issue turned out to be with an import of style-loader/css-loader/sass-loader that was in config.js. Removing that import and using preset-scss instead resolved the issue. My best guess is that one or more npm package upgrades as a part of the Angular v10 upgrade caused that import to break.

Thank you for your help. Closing this issue.

All 2 comments

Found out some additional information.

We're using this line:

import '!style-loader!css-loader!sass-loader!../src/styles.scss';

in our config.js to process our scss. This made the Storybook build stop working after the Angular v10 upgrade.
If I take out sass-loader, the Storybook build completes. However, it gets scss releated errors.
My guess that this stopped working is because the versions of the packages (style-loader, css-loader and sass-loader) were updated by the Angular v10 directly or indirectly.

If I use just main.js which doesn't need that line to process scss, the storybook builds again and works.

I would like to use main.js but we have an external dependency that won't let us use that quite yet.

So, do you have any suggestions on how to troubleshoot and/or work around this issue?

Thanks

Just in case someone else encounters the Storybook build hanging after upgrading to Angular 10, the issue turned out to be with an import of style-loader/css-loader/sass-loader that was in config.js. Removing that import and using preset-scss instead resolved the issue. My best guess is that one or more npm package upgrades as a part of the Angular v10 upgrade caused that import to break.

Thank you for your help. Closing this issue.

Was this page helpful?
0 / 5 - 0 ratings