Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 routing doesn't detect new routes #5247

Closed
1 task done
xHomu opened this issue Jan 25, 2023 · 22 comments · Fixed by #5266
Closed
1 task done

V2 routing doesn't detect new routes #5247

xHomu opened this issue Jan 25, 2023 · 22 comments · Fixed by #5266
Assignees

Comments

@xHomu
Copy link
Contributor

xHomu commented Jan 25, 2023

What version of Remix are you using?

v1.11.1

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

  1. npx create-remix and go through all the steps.
  2. add future: {v2_routeConvention: true,} toremix.config.js.
  3. npm run dev
  4. Create app/routes/test.tsx and a basic export default component.
  5. Visit localhost:3000/test

Expected Behavior

See the test route.

Actual Behavior

404 Not Found thrown.

  • If we restart the dev server manually, route renders correctly.
  • Untoggle v2_routeConvention, route renders correctly.
  • Edits to existing route files work as expected.

sample repo:
https://github.com/xHomu/remix-v2-routes-new2/blob/main/app/routes/test.tsx

@mcansh
Copy link
Collaborator

mcansh commented Jan 25, 2023

unfortunately i'm unable to reproduce with your repo

both the CLI and browser pick up the new file

Done in 24ms.
💿 File created: app/routes/my-new-route.tsx
💿 Rebuilding...
💿 Rebuilt in 97ms
GET / 200 - - 3.490 ms

Rebuilding...

Done in 33ms.
💿 File changed: app/routes/my-new-route.tsx
💿 Rebuilding...
💿 Rebuilt in 83ms
GET / 200 - - 5.460 ms
GET /my-new-route 200 - - 17.775 ms

@xHomu
Copy link
Contributor Author

xHomu commented Jan 25, 2023

Mmm, still getting this error. I'll switch up my setup a bit to see if I can narrow down if it's a local issue:
image

@xHomu
Copy link
Contributor Author

xHomu commented Jan 25, 2023

Tested on different environments, seems to be a Windows-specific bug:

✔️ StackBlitz
✔️ Mac
❌ Windows laptop
❌ Windows PC

@mcansh
Copy link
Collaborator

mcansh commented Jan 25, 2023

hm, i'll pull windows up shortly and see what i can come up with

thanks for debugging!

probably has to do with fast-glob and windows style paths, but i'll confirm here in a few

@mcansh
Copy link
Collaborator

mcansh commented Jan 26, 2023

yep, fast glob will return posix style paths / instead of windows \\ - will go out in the next release. not entirely sure why the first boot of the app works though...

@mcansh mcansh linked a pull request Jan 26, 2023 that will close this issue
2 tasks
@mcansh mcansh added the awaiting release This issue has been fixed and will be released soon label Feb 14, 2023
@github-actions github-actions bot added the needs-response We need a response from the original author about this issue/PR label Apr 18, 2023
@trevor-hackett
Copy link

I'm still seeing this issue on Windows. Has the fix been released?

@github-actions github-actions bot removed the needs-response We need a response from the original author about this issue/PR label Apr 18, 2023
@stepniaczky
Copy link

I'm still seeing this issue on Windows. Has the fix been released?

I'm seeing it as well

@mcansh
Copy link
Collaborator

mcansh commented Apr 19, 2023

it seems to be hit or miss on when it reloads for some reason as creating 2 files does trigger it for me and other times it works every time... - looking into it

this time it is not a path separator issue though 😉

@pcattori is working on compiler updates, so please try the nightly tag on npm for all remix deps and let me know if you still run into issues

@stepniaczky
Copy link

@mcansh, Unfortunately, nothing has changed

@trevor-hackett
Copy link

@mcansh, Unfortunately, nothing has changed

Same. Still not working. For me, it never works until the process is restarted

@stepniaczky
Copy link

stepniaczky commented Apr 20, 2023

In my case, however, the error was on my side because I was using routes nested in directories and subdirectories according to the official Get Started Remix (https://remix.run/docs/en/1.15.0/tutorials/blog), the documentation (https://remix.run/docs/en/1.15.0/guides/routing) and other sources on the internet that I came across. Only later did I realise that the routes directory must look like this is described here: https://remix.run/docs/en/main/file-conventions/route-files-v2.

@bamontales
Copy link

Same with me using v1.15.0 and Windows, still can't detect new routes.

@machour machour added v2 Issues related to v2 apis and removed awaiting release This issue has been fixed and will be released soon labels Apr 26, 2023
@machour
Copy link
Collaborator

machour commented May 1, 2023

From what I understand, this should be fixed in 1.16.0
Can someone confirm? 🙏🏼

@machour machour added the needs-response We need a response from the original author about this issue/PR label May 1, 2023
@xHomu
Copy link
Contributor Author

xHomu commented May 1, 2023

From what I understand, this should be fixed in 1.16.0 Can someone confirm? 🙏🏼

@machour seems like still unresolved on v1.16:

image

this is despite remix routes picking up the file:

image

@machour machour removed the needs-response We need a response from the original author about this issue/PR label May 1, 2023
@trevor-hackett
Copy link

Can confirm that the same behavior is still happening.

When the dev server is running, all route changes (new files, deletions, renames, etc.) are not detected until the dev server is stopped and restarted.

@remix-run remix-run deleted a comment from github-actions bot May 2, 2023
@mcansh
Copy link
Collaborator

mcansh commented May 3, 2023

this time it is not a path separator issue though 😉

turns out it is a path issue, but higher up the chain..

@bluefire2121
Copy link

bluefire2121 commented May 3, 2023

I'm having this issue on Windows. Was working in 1.14.3, no longer working. Currently using 1.16.0.

Update:

This works for me in 1.16.0.

My issue was that I was using remix.config.ts (as I attempted to switch it to Typescript). The remix config file must be Javascript.

@trevor-hackett
Copy link

Just noticed that this is now working in the latest nightly builds!

@mcansh
Copy link
Collaborator

mcansh commented May 4, 2023

Just noticed that this is now working in the latest nightly builds!

woo!

i messed up the bot so it didn't post an update here with details, sorry!

the version is 0.0.0-nightly-6563a94-20230504 for future folks

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 1.16.1-pre.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@xHomu
Copy link
Contributor Author

xHomu commented May 17, 2023

@mcansh Can confirm that new routes are now working in windows with v2 routing flag on!

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 1.16.1 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants