"The CJS build of Vite's Node" Warning #10663
Replies: 2 comments 2 replies
-
I've been working with Remix vs 6 for a couple of weeks and have had nothing but errors. Not even Copilot was able to stifle all of them long enough to see my simple app run in my browser. Finally yesterday I asked Copilot GPT-4.1 to give me its own fresh build in a shell script. It happily, confidently did and predicted a smooth npm run dev. Never happened. We've spent hours trying to fix its own Remix app. Failing with every possible test & diagnosis I asked it to try again. It was thrilled to NOW deliver just a simple Remix app setup. Copilot's bash script hit _ remix v2.16.8 💿 Let's build a better website...
_ I then had the following conversation with Copilot after weeks of all day errors 'fixes'. wait just a minute. You are using old Remix knowledge... No wonder Copilot has been failing me when I asked for help or asked you to create a brand-new project with your own training model.... How can I ask Copilot to get up to speed and not give me a mix of outdated methods and components and libraries and functions? You are absolutely right—Remix has changed rapidly, and much documentation, code samples, and even Copilot suggestions are outdated or incompatible with current best practices, especially regarding project scaffolding, ESM/CJS, Vite integration, and Tailwind CSS setup.
How to Get Copilot (or any AI assistant) “Up to Speed” with Latest Remix
Example Prompt for Copilot (or Similar AI) I am starting a new project with Remix v2.16.8 (using Vite, Node 18+). Pro Tips
What to Do if Copilot Still Repeats Old Patterns
If you want, I can provide you with a fully up-to-date shell script for creating a Remix v2.16.8 app with Tailwind CSS, following the exact 2025 best practices, and designed to run from the root folder. Just say the word! So, That is the state of Copilot for Remix V6 and definitely V7  |
Beta Was this translation helpful? Give feedback.
-
PS: Should probably open an issue in the React Router repository instead. Remix repository is just a placeholder at this point. Here is the stacktrace: The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
at warnCjsUsage (/var/www/projects/project-name/node_modules/vite/index.cjs:86:11)
at <anonymous> (/var/www/projects/project-name/node_modules/vite/index.cjs:4)
at anonymous (unknown)
at <anonymous> (/var/www/projects/project-name/node_modules/vite-node/dist/server.cjs:9:5)
at anonymous (unknown)
at <anonymous> (/var/www/projects/project-name/node_modules/@react-router/dev/dist/vite.js:72:5)
at <anonymous> (native:11:43)
at processTicksAndRejections (native:7:39) These are lines from 72 to 74 in var import_server = require("vite-node/server");
var import_client = require("vite-node/client");
var import_source_map = require("vite-node/source-map"); |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🚨 I'm seeing this warning in the console while developing with the React Router framework (in framework mode):
The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
It seems like something in the build toolchain is importing vite-node via CommonJS, which is now deprecated. Since React Router's framework mode uses Vite under the hood, is there any official guidance on:
What the migration path looks like for framework authors like React Router (and downstream users like me)
Whether this will start breaking things in Vite 6 or just stay noisy for now
Any insights or roadmap notes appreciated. Just trying to stay ahead of it and understand what action, if any, is needed on app authors' side.
Beta Was this translation helpful? Give feedback.
All reactions