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

sanity start failed to compile #2880

Closed
andyhong opened this issue Oct 19, 2021 · 6 comments
Closed

sanity start failed to compile #2880

andyhong opened this issue Oct 19, 2021 · 6 comments

Comments

@andyhong
Copy link

Describe the bug

I'm new to Sanity and have not been able to use sanity start to start using the service. The error messages are pasted below.

To Reproduce

Steps to reproduce the behavior:

  1. cd to directory
  2. sanity start
  3. See error

Expected behavior

Sanity Studio to successfully compile.

Which versions of Sanity are you using?

@sanity/cli 2.21.5 (up to date)
@sanity/base 2.21.5 (up to date)
@sanity/core 2.21.5 (up to date)
@sanity/default-layout 2.21.5 (up to date)
@sanity/default-login 2.21.4 (up to date)
@sanity/desk-tool 2.21.5 (up to date)
@sanity/vision 2.21.5 (up to date)

What operating system are you using?

macOS Big Sur v11.5.2

Which versions of Node.js / npm are you running?

npm 8.1.0
node v17.0.0

Additional context

Here's the error during compile step:

Error in ./schemas/schema.js (part:@sanity/base/schema)
Module build failed: Error: error:0308010C:digital envelope routines::unsupported
at Generator.next (<anonymous>)
at new Promise (<anonymous>)
@ ./node_modules/@sanity/vision/lib/SanityVision.js 12:37-73
@ ./node_modules/@sanity/vision/lib/VisionTool.js
@ ./node_modules/@sanity/vision/lib/VisionTool.js (all:part:@sanity/base/tool)
@ ./node_modules/@sanity/default-layout/lib/router.js
@ ./node_modules/@sanity/default-layout/lib/Root.js (part:@sanity/base/root)
@ ./node_modules/@sanity/base/lib/components/SanityRoot.js (part:@sanity/base/sanity-root)
@ ./node_modules/@sanity/server/lib/browser/entry-dev.js
@ multi ./node_modules/@sanity/server/lib/browser/entry-dev.js

I've deleted node_modules and reinstalled packages via npm install and sanity install

@rexxars
Copy link
Member

rexxars commented Oct 19, 2021

Thanks for reporting, this seems to be caused by node 17 having upgraded to OpenSSL3, causing issues for ecosystem components like webpack.

We'll be following this up in the coming days trying to find the best solution, but for now I'd recommend either using node 16 or running export NODE_OPTIONS=--openssl-legacy-provider before starting sanity in order to work around it.

@andyhong
Copy link
Author

Going back to node 16 did the trick. Thanks!

@surjithctly
Copy link

Any solution for this? I recently upgraded to 17, but this issue happened.

@kr1st1nagr03g3r
Copy link

kr1st1nagr03g3r commented Mar 16, 2022

I had the exact same issue. Using NVM, I switched to node v16.0.0 and it works perfectly now. Thanks! 😎

@gercamjr
Copy link

I am on node v16.3.1 and I get the above error. How do I run the export command?

@rexxars
Copy link
Member

rexxars commented Dec 12, 2022

In Sanity Studio v3 we've switched to a different bundler which fixes this issue - if you're still having issues with this in v2, try the aforementioned NODE_OPTIONS trick.

@rexxars rexxars closed this as completed Dec 12, 2022
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

No branches or pull requests

5 participants