Skip to content
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

Problem with storybook build failing depending on the state of package lock #1092

Closed
ktw1016 opened this issue May 21, 2021 · 6 comments
Closed
Labels
bug Something isn't working dependencies Pull requests that update a dependency file urgent

Comments

@ktw1016
Copy link
Contributor

ktw1016 commented May 21, 2021

For whatever reason, if you do a clean install: remove node_modules and pacakge-lock.json -> npm install
Storybook is failing on the resulting lock file.

Error msg is something like: TypeError: Cannot read property 'get' of undefined

As a workaround, we're not doing a clean install, and only doing npm install <dependency> on top of the existing package-lock.json on master. However, this is only short-term temporary solution and it's something that should be taken care of sooner or later

Things I've tried fixing:

  • Installing dotenv-webpack: It fixed for me locally but fails on CI with the message The 'compilation' argument must be an instance of Compilation
  • Updating storybook to 6.2.5 and/or 6.2.9: Still fail
  • I also tried all the combinations above (6.2.5 and 6.2.9 with/without dotenv-webpack)
  • Tried setting config.resolve.fallback = { http: false, }

Links for fixing I looked into:
storybookjs/storybook#14497
https://stackoverflow.com/questions/67070802/webpack-5-and-storybook-6-integration-throws-an-error-in-defineplugin-js

@ktw1016 ktw1016 added bug Something isn't working dependencies Pull requests that update a dependency file urgent labels May 21, 2021
@ktw1016
Copy link
Contributor Author

ktw1016 commented May 21, 2021

I think that new "compilation error" might be fixed with this? jantimon/html-webpack-plugin#1451 (comment) didn't bother to try because I worried it'd be going to too hacky territory

@Stephen-ONeil
Copy link
Contributor

Stephen-ONeil commented May 21, 2021

  • Installing dotenv-webpack: It fixed for me locally but fails on CI with the message The 'compilation' argument must be an instance of Compilation

I get The 'compilation' argument must be an instance of Compilation's locally in that instance too. Might be a linux thing, will look in to it more some time myself.

It won't close this issue, but it would be more secure if we could identify what versions of what packages cause this and lock them down (temporarily) in our package.json. It's not just a clean install that could cause this, an upgrade or even an audit (if one of the "good" versions requires an update to address a security concern) could also bump whatever the working combination of packages is up to whatever the broken combination of packages is.

I hadn't bothered locking any versions because I was kinda hoping things were getting fixed upstream. Some of those issues you linked with workarounds for these errors are over half a year old and already closed though. We might need to go the length of documenting/recreating this and opening a new issue about it if we actually want it fixed.

If we can stabilize things by locking the right package versions, then the urgent label at least could be removed here.

@ktw1016
Copy link
Contributor Author

ktw1016 commented May 21, 2021

Good point, locking down the "good" version of problematic packages would justify to remove the urgent tag

@Stephen-ONeil
Copy link
Contributor

Stephen-ONeil commented Jun 14, 2021

Update: everything is working for me with storybook 6.3.0-rc.5

Someone reopened the closed .env issue here, fix got in to the release candidate here edit: oops, grabbed the wrong PR link there, one second. Presumably our secondary issues were resolved somewhere else.

I'll be watching for the official 6.3.0 release. Expect a little bit of migration issues in the switch (getting some webpack config warnings on the release candidate), but should finally be able to move past this 👍

@Stephen-ONeil
Copy link
Contributor

Not immediately clear if this (or the .env related portion at least) was actually intentionally fixed. Not seeing any specific storybook PRs or commits in 6.4.0-rc.5 referencing the current issue. Possible it was indirectly fixed in the process of other storybook dependency changes 🤷. Fingers crossed 6.3.0 still resolves it all once it drops.

@Stephen-ONeil
Copy link
Contributor

Oops, closed by #1165

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file urgent
Projects
None yet
Development

No branches or pull requests

2 participants