-
Notifications
You must be signed in to change notification settings - Fork 2.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 12 and Storybook with Webpack 5 issues #5688
Comments
The first screenshot is showing babel warnings that shouldn't affect building or anything. You should be able to avoid them with |
I am getting the exact same errors, REPRODUCE:
RESULT:
I can use this header component in my test-app and it works. I have tried creating fresh workspaces multiple ways and am getting this same error every time. What I have tried:
NX REPORT Node : 14.15.1 nx : Not Found |
@literalpie thanks for the tip to remove those babel warnings!
did not fix the error, storybook still does not run in new nx workspace |
@kingjordan thanks for reporting. We're looking into this. Though this seems to be a Storybook + Angular 12 related thing as even with a plain Angular CLI project it doesn't work. There's an open Storybook issue (#5688 (comment)) which tracks the current Angular 12 status. (we will add the babel |
@juristr thanks for looking into this, the joys of having third party library dependencies 😜 |
I am facing the same issue. is there any way to solve it? with an old version? thanks guys. I tried to run the storybook with the angular cli 12 only, and it worked. |
Hey all, looks like the latest Storybook 6.3.0 alpha fixes most of the issues. I created a repo that shows a working version of Nx 12 + Ng 12 + Webpack 5 and Storybook. Specifically this commit shows what to do to fix it: juristr/nx-angular12-storybook-webpack5@229a596 I'll keep this issue open as a reference and for following along as the Storybook folks fix this and provide a proper release. Hopefully this unblocks you all for now |
@juristr can you double-check that building storybook works? |
@MickL yep the storybook build still fails. The problem is that I'm looking into it |
As a quick update. I'm in contact with the Storybook team and they're looking into it. This is a weird NPM package hoisting issue 🤷♂️ |
thanks @juristr |
@kingjordan cool. Yeah I know the Storybook folks is working on a fix so hopefully we have one in the next couple of days 🤞 |
@dean-g Here there is more info: storybookjs/storybook#14909 (comment). Basically you need to change the |
It's working now!. thank you very much @juristr |
Try with the latest storybook alpha (6.3.0-alpha.42) and |
I did the fresh run today. got into the following error: Cannot find module '@storybook/manager-webpack5' installed: yarn add @storybook/manager-webpack5 after this getting new error: Cannot find module '../presets/manager-preset'
@juristr Can you please check this and advise? |
@dean-g I was just about to test the release as well as this was the proposed solution from the meeting with the Storybook team last week. Upgrading to the latest alpha release fixed the build for me as well. Here's my commit to the example repo: juristr/nx-angular12-storybook-webpack5@dadfe13 I will closely monitor the 6.3 release as it stabilizes and prepare an Nx migration to make sure all Angular 12 folks are migrated to 6.3. Keep an eye on this issue to be notified (I'll keep this open for tracking and update purposes) |
Thank you @juristr My build got to succeed now but getting a few Conflicting errors and the storybook is not starting up. Please check this and advise. |
I was able to make it work with the following configuration:
For some reason, npm installed a react/react-dom version 15.x.x and I had an error in the console: |
Here I also have issues when running storybook with nrwl@12.3.6 and ng@12. When running
|
FYI, I'm also having success with Storybook 6.3.0-rc.2. Just make sure to update your builder, and convert all of your knobs to controls, because knobs are removed in 6.3.0. Heaviest lift is the knobs => controls but that was already deprecated, so we knew that was coming eventually. https://gist.github.com/shilman/8856ea1786dcd247139b47b270912324 |
@JSMike yeah we're already working to make sure the new setups get generated with controls rather than knobs and maybe we're able to provide a migration for that as well. @spierala can you have a look at my setup: https://github.com/juristr/nx-angular12-storybook-webpack5. That's a working one, have a look especially at the last 2 commits which show the packages I've added to get it working. I'm currently waiting for Storybook to cut the 6.3 and then we'll release an Nx migration to upgrade folks to a running version. |
@juristr when using your setup I'm still getting the |
@stefan-schweiger yep, that's a new thing that came up recently. It's being discussed here on the Storybook repo and a blocker for their 6.3 release atm |
@juristr can you please help me to resolve this error related to build angular-storybook. |
@ahmedbillalimtiazghumman hard to tell without more info. Looks to me like the |
@juristr i have not changed anything, it is working with angular v9, i am getting this error after updating to angular v12. |
If someone is still looking around for a solution, here is what worked for me with storybook 6.2.7 version and angular 12/nx 12.3.6 :
This fixed the warning - "Cannot read property 'minify' of undefined" After this, I was able to build and run storybook without any errors |
That's exactly his point. You HAVE to change something to make your config compatible with Webpack 5 |
Would like to know myself what needs to be changed to work with Angular 12 / Webpack 5 |
@shagene my current workaround is to add the following:
I still get the error message in the console, but at least storybook starts up and I can use it. |
@HarlesPilter This PR should fix that #6129 |
@juristr do you know if Nx will integrate the new storybook builders? storybookjs/storybook#15061 |
@jogelin hey, it's on my list to give them a look and verify whether it might be useful integrating them into Nx (once I'm back from vacation 😉) |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Can't run storybook based on nx angular, nx run shared-ui:storybook
Expected Behavior
Run storybook on web-server
Steps to Reproduce
npx create-nx-workspace@latest storybook-example
nx g library shared/ui --tag=scope:shared,type:ui
nx g c nav --flat -s -t --skipTests --project=shared-ui
npm i @nrwl/storybook -D
nx g @nrwl/angular:storybook-configuration shared-ui
nx run shared-ui:storybook
This issue may not be prioritized if details are not provided to help us reproduce the issue.
Failure Logs
Environment
Node: v14.17.0
Npm: 7.13.0
The text was updated successfully, but these errors were encountered: