But, when type: module is present in package.json it yields an error in Node
node:internal/modules/esm/get_format:160
throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath);
^
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/simeongriggs/Sites/sanity-remix-template/scripts/createData.ts
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
at defaultLoad (node:internal/modules/esm/load:143:22)
at async ModuleLoader.load (node:internal/modules/esm/loader:409:7)
at async ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:45)
at async link (node:internal/modules/esm/module_job:76:21) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
Node.js v20.11.0
Removing it makes the CLI work, but then produces this warning during development
The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
When you first clone this repo you're prompted to run a Sanity CLI script to populate the dataset.
But, when
type: module
is present inpackage.json
it yields an error in NodeRemoving it makes the CLI work, but then produces this warning during development