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

Vite CJS / ESModule warning #240

Open
jhwz opened this issue Nov 8, 2022 · 2 comments
Open

Vite CJS / ESModule warning #240

jhwz opened this issue Nov 8, 2022 · 2 comments

Comments

@jhwz
Copy link

jhwz commented Nov 8, 2022

When running a svelte-kit server with the project vite outputs the following warning:

@cfworker/uuid doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.

It's no big problem, setting:

ssr: {
    noExternal: ['@cfworker/uuid']
}

in vite.config.js resolves the issue, but would be nice to have the warning removed.

@JoshZA
Copy link

JoshZA commented Jan 25, 2023

This affects other modules as well

@cfworker/cosmos doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.

@houmark
Copy link

houmark commented Jan 30, 2024

Hi @jdanyow — I hit this issue with @cfworker/uuid while trying out Remix using Vite for Cloudflare Pages.

I'm not sure if the fix is as simple as it looks on the surface, but I'd love to see a fix that makes Vite happy.

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

3 participants