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

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

Open
ashleysommer opened this issue Jun 24, 2024 · 2 comments · May be fixed by #163
Open

Comments

@ashleysommer
Copy link
Contributor

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
Copy link
Contributor Author

I see, it was this issue. ivesia/vite-plugin-rewrite-all#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
Copy link
Contributor Author

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.

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

Successfully merging a pull request may close this issue.

1 participant