sanity-codegen icon indicating copy to clipboard operation
sanity-codegen copied to clipboard

Missing dependencies?

Open toresbe opened this issue 2 years ago • 1 comments

Hiya,

I am learning sanity with a basic Typescript create-next-app. I followed the installation instructions and ran yarn add --dev sanity-codegen prettier, but it failed with Error: Cannot find module '@babel/core'.

After cycling through attempts to run and adding missing dependencies, I found that yarn add --dev @babel/core @babel/preset-env @babel/preset-typescript @babel/preset-react jsdom gets me a working setup so far.

toresbe avatar Mar 08 '22 10:03 toresbe

I ran into Error: Cannot find module '@babel/core' now, but it turned out to be because I was using sanity-codegen in a bare project that missed the standard Sanity packages (@sanity/base, @sanity/core etc.). In a normal Sanity project, the babel packages should already be available.

danmichaelo avatar Mar 22 '22 10:03 danmichaelo