API route in Route Group not picked up?

Migrating to RC1 caused my API routes in Route Groups (https://start.solidjs.com/core-concepts/routing#route-groups) to stop working? For a minimal repro, do a npm init solid@latest and create the file apiget.ts
export function GET() {
return new Response('Hello World');
}
export function GET() {
return new Response('Hello World');
}
placing it here:
src/
routes/
apiget.ts
src/
routes/
apiget.ts
navigating to /apiget returns the proper Hello World. placing it here:
src/
routes/
blah/
apiget.ts
src/
routes/
blah/
apiget.ts
navigating to /blah/apiget returns the proper Hello World. placing it here:
src/
routes/
(blah)/
apiget.ts
src/
routes/
(blah)/
apiget.ts
navigating to /apiget returns a 404 now, whereas in the v.3 version, it worked and would return the proper API response.
5 Replies
Madaxen86
Madaxen867mo ago
Did you add the „// @refresh reload“ to server and client entry?
Some Call Me Tim
Some Call Me TimOP7mo ago
I didn't, they were added when I installed the default rc1 project. I installed the lastest RC1 unocss template, then just slowly migrated my files over, fixing bugs as they popped up. This is the only one so far that I've not been able to get going. this also happens without any of my code, in a default Solid Start RC1 project. For fun, change apiget.tsx to contain the following:
export default function ApiGet() {
return <div>Why do I work in a Route Group, but the API call doesn't?</div>;
}
export default function ApiGet() {
return <div>Why do I work in a Route Group, but the API call doesn't?</div>;
}
now refresh http://localhost:3000/apiget, and you'll get the component output.
Some Call Me Tim
Some Call Me TimOP7mo ago
No description
Some Call Me Tim
Some Call Me TimOP7mo ago
Found an issue where this was fixed previously: https://github.com/solidjs/solid-start/issues/1176 , so it seems like a regression. I've filed a bug report.
Want results from more Discord servers?
Add your server