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

TypeScript error with module: node16 or nodenext while importing vite-plugin-turbosnap #8

Open
saschanaz opened this issue Jul 8, 2023 · 1 comment

Comments

@saschanaz
Copy link

https://www.typescriptlang.org/play?target=99&moduleResolution=99&module=100#code/JYWwDg9gTgLgBDArlARhAzgOwIZjgMyghDgHIA3YGAUwFowAbRAc2E1qVQxzFICg+nNFlwAKAN5wiEGABFgUAFxlScAL4BKIA

This expression is not callable.
  Type 'typeof import("file:///node_modules/vite-plugin-turbosnap/dist/index")' has no call signatures.(2349)

This happens in TS 5.1.6.

@psychobolt
Copy link

Related: vitejs/vite#10481.

For ESM projects, you can use a patch:

diff --git a/package.json b/package.json
index 43dab1681043cc814049b01d91212b3f63faae68..38072d9e897532ec42138b978dbecfe0d8c90278 100644
--- a/package.json
+++ b/package.json
@@ -32,7 +32,8 @@
       "types": "./dist/index.d.ts"
     }
   },
-  "main": "dist/index.cjs",
+  "type": "module",
+  "main": "dist/index.mjs",
   "module": "dist/index.mjs",
   "types": "dist/index.d.ts",
   "scripts": {

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

2 participants