You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using sanity-plugin-singleton-tools with vite (+ svelte but i'm not sure it's related), I get a SyntaxError: Cannot use import statement outside a module.
Reproduction
Create a vite + sanity project (without bundlers as modules).
I'm using this configuration :
Note : I have no typing error using these configurations.
Error shown in the console :
C:\...\project_folder\node_modules\sanity-plugin-singleton-tools\dist\index.esm.js:1
import { DocumentIcon } from "@sanity/icons";
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (node:internal/modules/cjs/loader:1281:20)
at Module._compile (node:internal/modules/cjs/loader:1321:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at cjsLoader (node:internal/modules/esm/translators:348:17)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:297:7)
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async nodeImport (file:///C:/.../project_folder/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:53056:15)
I manage to fix this issue by remove by hands the exports property on the module's package.json.
I didn't found another way to fix it. I'm not a pro of configuring this file but is this property very important ? (When removing it I had no typing issues, but the module is function as well as it should)
Last thing :
I didn't found any issue like this one on Internet (forums, docs, ...)
The text was updated successfully, but these errors were encountered:
Issue
When using
sanity-plugin-singleton-tools
with vite (+ svelte but i'm not sure it's related), I get aSyntaxError: Cannot use import statement outside a module
.Reproduction
Create a vite + sanity project (without bundlers as modules).
I'm using this configuration :
Dependencies versions
Solutions
I manage to fix this issue by remove by hands the
exports
property on the module's package.json.I didn't found another way to fix it. I'm not a pro of configuring this file but is this property very important ? (When removing it I had no typing issues, but the module is function as well as it should)
Last thing :
I didn't found any issue like this one on Internet (forums, docs, ...)
The text was updated successfully, but these errors were encountered: