RDFLib / prez-ui

BSD 3-Clause "New" or "Revised" License
10 stars 7 forks source link

[ERROR] "vite-plugin-rewrite-all" resolved to an ESM file. ESM file cannot be loaded by `require`. #161

Open ashleysommer opened 5 months ago

ashleysommer commented 5 months ago

Steps to reproduce:

1) Clone prez-ui 2) ~> yarn install 3) ~> yarn run build

Output: [ERROR] "vite-plugin-rewrite-all" resolved to an ESM file. ESM file cannot be loaded by require.

See full error output here: https://gist.github.com/ashleysommer/123e9186b948aa2fa24fb99fb72d880c

Also occurs with yarn dev

The error mentions to check out this page: https://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only But that doesn't help me much. I assume this used to work and recently broke, maybe a new incompatible version of vite-plugin-rewrite-all was released recently.

ashleysommer commented 5 months ago

I see, it was this issue. https://github.com/ivesia/vite-plugin-rewrite-all/issues/7 vite-plugin-rewrite-all released v1.0.2 with this bug, then was deprecated, so no new release with a fix will be coming out. So we'll have to pin to v1.0.1 or find a replacement package.

ashleysommer commented 5 months ago

Note, when re-testing this with NPM, I see npm installs package versions that are locked in the package-lock.json lockfile, that is set to v1.0.1.

It is only when running npm update or yarn install it will check the dependency version pattern ^1.0.1 in the package.json and installs the broken v.1.0.2 package.