solidjs / templates

Vite + solid templates
443 stars 118 forks source link

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

Open DIPANJAN01 opened 1 month ago

DIPANJAN01 commented 1 month ago

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

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 commented 1 month ago

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.