diff --git a/.changeset/shiny-timers-bake.md b/.changeset/shiny-timers-bake.md new file mode 100644 index 00000000000..9c815ee3251 --- /dev/null +++ b/.changeset/shiny-timers-bake.md @@ -0,0 +1,5 @@ +--- +"@remix-run/dev": patch +--- + +Add `@remix-run/node` to Vite's `optimizeDeps.include` array diff --git a/packages/remix-dev/vite/plugin.ts b/packages/remix-dev/vite/plugin.ts index b8ffd45b909..c0c3f5e4144 100644 --- a/packages/remix-dev/vite/plugin.ts +++ b/packages/remix-dev/vite/plugin.ts @@ -557,6 +557,7 @@ export const remixVitePlugin: RemixVitePlugin = (options = {}) => { // That means that before Vite pre-bundles dependencies (e.g. first time dev server is run) // mismatching Remix routers cause `Error: You must render this element inside a element`. "@remix-run/react", + "@remix-run/node", ], }, esbuild: {