Closed xxholly32 closed 1 year ago
publint is ESM only and the nodejs environment you use should support the "exports"
field, and not only "main"
. Can you show how you're importing publint
? If you're using it through @vitejs/release-scripts
, it is also an ESM only package, so I'm not sure how you're seeing the issue.
For ESM only packages, make sure you're import
ing it and not require
.
https://github.com/xxholly32/element-plus/commit/cad196297937f28b32b759ac39476aef02534c22
I would like to propose a pr for element-plus by adding @vitejs/release-scripts ;
Renaming the scripts from .ts
to .mts
should do the trick. e.g. publish.ts
-> publish.mts
. tsx
is converting to CJS under the hood.
yes. It does solve the problem. ty for your time ❤
Error occurs when using @vite/release-script node version 18; Also, the project is not type:module
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in E:\workspace\element-plus-xx\node_modules.pnpm\@vitejs+release-scripts@1.2.1\node_modules\publint\package.json