epicweb-dev / full-stack-foundations

Learn the foundational skills of building full stack web applications.
https://epicweb.dev/workshops/full-stack-foundations
Other
586 stars 152 forks source link

No route matches URL error on live reload when moving favicons or adding objects to link function #90

Closed ajiteshchhatani closed 5 months ago

ajiteshchhatani commented 5 months ago

I have currently just started the 01. Styling module from the playground app and finished the first 3 exercises, namely

  1. Links to Public Files
  2. Asset imports
  3. Global styles.

I noticed an error every time I finished each of the above exercises and saved my code in the playground app.

Whenever I moved the favicon.svg from build folder and into app/assets or when I had to import from "./styles/font.css" and added those respective imports into my links function I saw the error as below in my workshop app command line on live reload

No routes matched location "/build/root-BWUZS27O.js" 
[playground:4000] ErrorResponseImpl {
[playground:4000]   status: 404,
[playground:4000]   statusText: 'Not Found',
[playground:4000]   internal: true,
[playground:4000]   data: 'Error: No route matches URL "/build/root-BWUZS27O.js"',
[playground:4000]   error: Error: No route matches URL "/build/root-BWUZS27O.js"

I had to restart the server on the workshop app every time by using the npm start command.

I am unable to figure out why live reload won't work correctly and apply the CSS or whatever we update inside the links function

Any help would be appreciated!

P.S: I already deleted the playground folder once and reran the npm run setup command to no luck.

kentcdodds commented 5 months ago

This is a limitation of Remix's compiler. Luckily:

  1. We don't often change what's in the links export in future exercises
  2. Remix now recommends using vite with the remix plugin and this problem goes away.

In the future, I'll update all of this material to use vite. For now, you should be ok after these first few exercises. Sorry for the trouble!