-
Notifications
You must be signed in to change notification settings - Fork 375
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
[Bug?]: API routes in file based Route Groups don't work in RC0 #1463
Comments
Just to add that a workaround is to duplicate the routes folder structure for API calls, but not including any Edit: Nope that actually doesn't work. The API route then works, but the initial route structure 500's with Edit2: What does work is hardcoding |
Yeah in 0.5 I seperated the API route handling and simplified the matcher. However, I ended up reverting this separation later in the release which is why things don't look different even though they work completely different now. Given that I brought the routes back in I suppose it is fair to see if we can support the other syntax. I do caution in general that co-locating is a poor pattern here as we resolve all API routes before render routes, so things like catch alls won't work perhaps as you might expect when shared in the same scope as page routes. But I see very little reason not to allow them to work under things like route groups given where we landed. |
Cool thanks Ryan, just to add some more context, the scenario is like this: For users to view their content, they go to: The |
Actually looking at it, it was intended to work. Looks like it was just a small mistake in the regex. Will get this fixed up shortly. |
Edit, just made a new issue: #1470 |
Duplicates
Latest version
Current behavior 😯
having an API route in a route group gives a 404, whereas in previous v.3 it worked.
I found this previous issue where it apparently was resolved? #1176
Expected behavior 🤔
I should be able to fire my API from inside a route group.
Steps to reproduce 🕹
to replicate with a new project:
create
apiget.tsx
with the following :place it in
/routes
, and navigate tohttp://localhost:3000/apiget
. Works.Move
apiget.ts x
into a new/routes/(blah)/
folder and refreshhttp://localhost:3000/apiget
, and you'll get a 404.For fun, change
apiget.tsx
to contain the following:now refresh
http://localhost:3000/apiget
, and you'll get the component output.Context 🔦
I have a URL which needs to dynamically redirect to an image after some database checks. That URL is nested in some layout files with nested contexts.
Your environment 🌎
The text was updated successfully, but these errors were encountered: