Love this plugin, thank you very much for making it!
We've recently installed the Sanity Notes plugin to allow us to add rich messaging/alerts/etc to our schemas, unfortunately this is breaking codegen. To get the notes plugin to work properly we need to rename files to JSX and import React/icons, e.g.
import React from "react"
^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:979:16)
at Module._compile (internal/modules/cjs/loader.js:1027:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/Users/dave/Github/bared-footwear-website/admin/src/parts/schema.js:148:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Module._compile (/Users/dave/Github/bared-footwear-website/admin/node_modules/pirates/lib/index.js:99:24)
I tried following the babel.config setup as outlined in the docs to use @babel/preset-env and @babel/preset-react, but that did not solve the issue as I noticed it's already in the default babel config file included with the package.
Hi there,
Love this plugin, thank you very much for making it!
We've recently installed the Sanity Notes plugin to allow us to add rich messaging/alerts/etc to our schemas, unfortunately this is breaking codegen. To get the notes plugin to work properly we need to rename files to JSX and import React/icons, e.g.
Now when I run
sanity-codegen
, I get this error:I tried following the babel.config setup as outlined in the docs to use @babel/preset-env and @babel/preset-react, but that did not solve the issue as I noticed it's already in the default babel config file included with the package.
Using: sanity v2.23.0 node v14.16.0 sanity-codegen v0.9.5