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

Set specific Node version #2080

Merged
merged 1 commit into from
Nov 8, 2022
Merged

Set specific Node version #2080

merged 1 commit into from
Nov 8, 2022

Conversation

tylersticka
Copy link
Member

@tylersticka tylersticka commented Nov 8, 2022

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:

  1. Run npm audit fix --force. This introduces many breaking changes.
  2. Set the NODE_OPTIONS environment variable to --openssl-legacy-provider everywhere. This felt clunky to me.
  3. Set some Webpack options. I attempted this, but it turns out those options are only available in Webpack 5, and this project is currently using version 4.
  4. Specify the previous LTS release in our .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

  1. Locally, make sure your nvm aliases are up to date by running nvm ls-remote
  2. git checkout main
  3. Recreate the error: nvm use && npm ci && npm start
  4. Now check out this branch.
  5. Try the previous command again: nvm use && npm ci && npm start
  6. Confirm there is no longer a build error.

Alternatively, you can compare the GitHub checks on this PR to that of #2079, which was stalled by this issue.

@changeset-bot
Copy link

changeset-bot bot commented Nov 8, 2022

⚠️ No Changeset found

Latest commit: 5fd3de7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Nov 8, 2022

Deploy Preview for cloudfour-patterns ready!

Name Link
🔨 Latest commit 5fd3de7
🔍 Latest deploy log https://app.netlify.com/sites/cloudfour-patterns/deploys/636add164093540008ba9b7a
😎 Deploy Preview https://deploy-preview-2080--cloudfour-patterns.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@tylersticka tylersticka marked this pull request as ready for review November 8, 2022 22:54
@tylersticka tylersticka requested a review from a team November 8, 2022 22:55
Copy link
Member

@spaceninja spaceninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfectly reasonable solution, thanks Tyler!

@tylersticka tylersticka merged commit f4e995f into main Nov 8, 2022
@tylersticka tylersticka deleted the fix/new-ssl-req branch November 8, 2022 23:38
gerardo-rodriguez added a commit that referenced this pull request Dec 1, 2022
…terns into feature/aspect-ratio

* 'main' of https://github.com/cloudfour/cloudfour.com-patterns: (30 commits)
  Publish Next Version (#2090)
  Expand centered wp-block-image captions (#2089)
  Update dependency stylelint-config-prettier to v9.0.4
  Update dependency postcss to v8.4.19
  Update dependency eslint-plugin-react to v7.31.11 (#2085)
  Update dependency cssnano to v5.1.14
  Update dependency @types/lodash to v4.14.190
  Update dependency @changesets/cli to v2.25.2
  Publish Next Version (#2056)
  Moar social media exodus icons (#2081)
  Update dependency typescript to v4.9.3 (#2031)
  Update brand icons (#2079)
  Set specific Node version (#2080)
  Update dependency eslint to v8.25.0
  Update dependency rollup-plugin-dts to v4.2.3 (#2075)
  Update dependency postcss to v8.4.18 (#2074)
  Update dependency eslint-plugin-react to v7.31.10 (#2073)
  Update dependency @babel/preset-env to v7.19.4 (#2072)
  Update dependency @changesets/cli to v2.25.0
  Update dependency postcss to v8.4.17
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants