📦 Out of the box and into your content operations: explore the Spring Release

Node.js update resolves error after Sanity upgrade in Slack thread

4 replies
Last updated: Apr 22, 2025
Hey everyone,
Just tried to update sanity using
yarn upgrade
and now getting this error when trying to run `yarn dev`:
yarn dev
yarn run v1.22.17
$ sanity dev
✓ Checking configuration files...
⠸ Starting dev server
TypeError: crypto$2.getRandomValues is not a function
    at resolveConfig (file:///C:/rb_repos/learning-cms/node_modules/vite/dist/node/chunks/dep-DG3BLbPj.js:48961:16)
    at async _createServer (file:///C:/rb_repos/learning-cms/node_modules/vite/dist/node/chunks/dep-DG3BLbPj.js:38255:18)
    at async startDevServer (C:/rb_repos/learning-cms/node_modules/sanity/lib/_chunks-cjs/devAction2.js:65:38)
    at async startSanityDevServer (C:/rb_repos/learning-cms/node_modules/sanity/lib/_chunks-cjs/devAction2.js:160:5)
error Command failed with exit code 1.
info Visit <https://yarnpkg.com/en/docs/cli/run> for documentation about this command.
Any thoughts or ideas?

Running node v16.20.0
Apr 22, 2025, 3:59 PM
What was your previous sanity version prior to your latest upgrade, and what is your current version? The first thing I can think of is that later versions of sanity may need higher versions of node. I'd recommend installing something in the range of 18 and above and see what happens.
Apr 22, 2025, 4:57 PM
Looks like the solution was to update Node.js
Apr 22, 2025, 4:58 PM
Oh nice! Glad you figured it out.
Apr 22, 2025, 4:58 PM
I was trying things still and just updated everything and it worked!
Apr 22, 2025, 5:55 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?