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
When using remix>=2.12, the notes data fetched by loader is gone when revisiting /notes page by Link components.
This problem only happens in dev mode. When running server by npm run build and npm start, it works fine as expected.
Debugging
To inspect the problem I logged useLoaderData() to the console.
Issue Description
When using remix>=2.12, the notes data fetched by loader is gone when revisiting /notes page by Link components.
This problem only happens in dev mode. When running server by
npm run build
andnpm start
, it works fine as expected.Debugging
To inspect the problem I logged
useLoaderData()
to the console.When visiting the /notes page for the first time, the loadedData is correctly set as list of note.
When visiting again by the Link component, the loadedData is just the JS code of type string.
Solution
Moving notes.json from the root of the project to app folder fixed the problem.
Related Issue on Stack Overflow
The text was updated successfully, but these errors were encountered: