-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Storybook TypeError: The 'compilation' argument must be an instance of Compilation on a new project #8538
Comments
@mandarini Seems like it's the webpack versions conflict. I've had the same issue during project dependencies update, and have just solved it. Check this PR I have updated all project dependencies to the latest versions except The solution that made storybook compile - https://github.com/rfprod/nx-ng-starter/pull/357/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R130 "resolutions": {
"webpack": "5.66.0"
} Commit ref rfprod/nx-ng-starter@6d89609 ( PS: While I was writing this message, my lovely computer verified that |
Hi there @wizardnet972 ! Thanks for filing an issue, I can reproduce this :) @rfprod thanks for providing a fix so quickly!! I can verify that adding
on my I'll make sure we push a fix for that! :) |
Oh, wait, I think just setting the |
@mandarini regarding my solution, maybe I should have mentioned that the webpack version should match the webpack version used by angular-devkit, i.e. this resolution may need to be updated according to the webpack version used by angular-devkit. If you plan to add this resolution to nrwl libs, won't it lead to worse consequences in future during updates?
I will try it in a minute. It will take some time to reinstall project dependencies without the webpack resolution config. |
Yes, running
fixes the issue! This is on a new Nx workspace, following the exact steps that @wizardnet972 suggested. I assume that in new workspaces, the versions will match. |
@mandarini projectBuildConfig did not work in my project, but it is not new, so it's irrelevant to this issue. |
@rfprod but it gets fixed when you do your solution? aligning the webpack versions etc? |
@mandarini yep, it does. The premerge pipeline validates each code change, and it does storybook test build. I've merge several PRs since introducing the fix. I believe only webpack version resolution fixes the issue in my case. |
Hello everyone Looking forward for storybook v7 ! |
You can already try out SB7 with Nx, you know!! :D :D ---> https://nx.dev/packages/storybook/documents/storybook-7-setup |
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
I just create a new project, install angular and storybook and then I run storybook command
yarn nx run nx-ui:storybook
.I got an error:
Expected Behavior
It should open the storybook dashboard.
Steps to Reproduce
The clone way:
OR run those commands:
Failure Logs
Environment
The text was updated successfully, but these errors were encountered: