Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
A few days ago, Node v18 became the latest LTS release. But our Storybook build commands fail in Node v17 or higher.
The reason for this is that Node changed its cryptographic security requirements in version 17. This breaks the way Webpack generates hashes.
After consulting this StackOverflow thread, I had a few options to address this:
npm audit fix --force
. This introduces many breaking changes.NODE_OPTIONS
environment variable to--openssl-legacy-provider
everywhere. This felt clunky to me..nvmrc
.I went with the last option.
We can update to the latest LTS release once Webpack is updated to version 5 or later, which I believe depends on Storybook. Or we can switch to Vite (see #1403).
Testing
nvm ls-remote
git checkout main
nvm use && npm ci && npm start
nvm use && npm ci && npm start
Alternatively, you can compare the GitHub checks on this PR to that of #2079, which was stalled by this issue.