Closed horans closed 7 months ago
Yes, i've updated the module to use ESM, because Vite 5 deprecated the CJS Node API, see https://vitejs.dev/guide/migration#deprecate-cjs-node-api You can fix it for now by setting "type": "module" in your package.json file, or use the .mjs extension, e.g. vite.config.mjs.
I'll look if I can create a hybrid version, so that CJS also will work for all users of Vite v4
I did some testing and it looks like it's really not needed to update to ESM, because Vite 5 still works with the CommonJS version of the package. I reverted this in release 5.1.0 so now the error should be gone.
v4.0.0 works fine (for a long time). v4.1.0+ (including latest v5.0.1/Vite5) is giving
"vite-svg-loader" resolved to an ESM file. ESM file cannot be loaded by "require"
error on dev.It's weird since I am not using "require" at all.
More details of the error:
my
vite.config.ts
is as follows: