You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you spin up the remix app (Remix App Server template) using npm run vite:dev and make changes to your loader and refresh the page, the new data from the loader is not reflected
Steps to reproduce
Create a new Remix app npx remix-kit@latest install and choose the Remix App Server template
cd my-remix-app
Install remix kit npx remix-kit@latest install
Start remix app using vite npm run vite:dev
Add a loader to routes/index.tsx and return a value
Load the page
Add a new value like 4 to the array and refresh the page, & youll see the server changes are not being reflected
If you use npm run dev (no vite) things work as expected after page reload, so it looks like its the vite dev server
Reproduction
001-vite-server-not-working.mp4
Example Code for routes/index.tsx
routes/index.tsx
import{typeLoaderArgs,json}from"@remix-run/node";import{useLoaderData}from"@remix-run/react";exportasyncfunctionloader({ request }:LoaderArgs){returnjson([1,2,3,])// ❌ after the initial page load, add a 4 inside the array and refresh the page}exportdefaultfunctionIndex(){constdata=useLoaderData();return(<divstyle={{fontFamily: "system-ui, sans-serif",lineHeight: "1.4",}}><h1>Welcome to Remix</h1><ul>{data.map((item:any)=>(<listyle={{color: 'pink'}}>{item}</li>))}</ul></div>);}
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a RemixKit issue and not a Remix specific issue. For example, if it's a Remix related bug, it should likely be reported to remix instead.
Check that this is a concrete bug. For Q&A open a GitHub Discussion.
Describe the bug
If you spin up the remix app (Remix App Server template) using
npm run vite:devand make changes to your loader and refresh the page, the new data from the loader is not reflectedSteps to reproduce
npx remix-kit@latest installand choose theRemix App Servertemplatecd my-remix-appnpx remix-kit@latest installnpm run vite:devroutes/index.tsxand return a value4to the array and refresh the page, & youll see the server changes are not being reflectedIf you use
npm run dev(no vite) things work as expected after page reload, so it looks like its the vite dev serverReproduction
001-vite-server-not-working.mp4
Example Code for
routes/index.tsxroutes/index.tsx
System Info
System: OS: macOS 13.0.1 CPU: (10) arm64 Apple M1 Pro Memory: 189.13 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.12.0 - ~/.volta/tools/image/node/18.12.0/bin/node Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn npm: 8.19.2 - ~/.volta/tools/image/node/18.12.0/bin/npm Browsers: Chrome: 108.0.5359.124 Safari: 16.1 npmPackages: @remix-kit/react: ^0.2.2 => 0.2.2 @remix-kit/vite: ^0.2.2 => 0.2.2 @remix-run/dev: ^1.9.0 => 1.9.0 @remix-run/eslint-config: ^1.9.0 => 1.9.0 @remix-run/node: ^1.9.0 => 1.9.0 @remix-run/react: ^1.9.0 => 1.9.0 @remix-run/serve: ^1.9.0 => 1.9.0Used Package Manager
npm
Validations