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

"The CJS build of Vite's Node API is deprecated" warning message #150

Open
DIPANJAN01 opened this issue Sep 17, 2024 · 1 comment
Open

Comments

@DIPANJAN01
Copy link

Describe the bug

When I install a solidjs project with Vite using npx degit solidjs/templates/js my-project (as the official docs suggest for installing a solidjs project with Vite), and then do npm run dev, I get this warning in the console:

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.

It seems to go away when I manually change the extension of vite.config.js to vite.config.mjs

Your Example Website or App

https://github.com/DIPANJAN01/solid-my-app.git

Steps to Reproduce the Bug or Issue

  1. npx degit solidjs/templates/js my-app
  2. cd my-app
  3. npm i
  4. npm run dev
  5. Observe the terminal

Expected behavior

Expected behavior: No warning in the console when the app is run with npm run dev

Screenshots or Videos

No response

Platform

  • OS: Linux (Ubuntu 24.04.1 LTS)
  • Editor: VSCode (1.93.1)
  • Solidjs version: 1.8.11

Additional context

Yes maybe its not a "bug" bug, but its still an annoying warning and just wanted to let you know about it...

@ryansolid
Copy link
Member

It's odd I admit. I think our projects are type="module" which means .js should be treated as .mjs. If not then we should do something about it. I will move this issue to the templates repo.

@ryansolid ryansolid transferred this issue from solidjs/solid Sep 17, 2024
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

2 participants