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

Move from package.json to deno.json -> All Vite projects complain about deprecated CJS mode #25574

Closed
birkskyum opened this issue Sep 11, 2024 · 2 comments · Fixed by vitejs/vite#18081
Labels
bug Something isn't working correctly node compat node resolution

Comments

@birkskyum
Copy link
Contributor

birkskyum commented Sep 11, 2024

Any project that's built on top of vite in some form (and there's quite a lot now), will check if the package.json has a "type":"module", and otherwise complain with this:

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

If a project only has a deno.json, it's thus necessary to make an extra package.json, just with { "type": "module" } to remove this issue.

I assume it's somehow related to this code in Vite - but some adjustment is needed for deno.json to be fully standalone.

Repro steps here, but any vite project will do:

@marvinhagemeister
Copy link
Contributor

Resolved by vitejs/vite#18081 . Fix will be released in the next vite release.

@birkskyum
Copy link
Contributor Author

Patch released in vite 5.4.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat node resolution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants