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?]: ts/js files placed inside of web/src are getting served instead of serving the proper route #9740
Comments
Hey @suzdalnitski, I'm not totally sure what the issue you're facing is, but there's a detail wrong in your reproduction that's probably leading to problems. If you want to add a new route to your web app that's accessible at It looks like you've added the file to |
Hey @jtoar, I was actually setting up authentication with Supertokens. I've ran You're correct, there's no Routes has this instead: const Routes = () => {
if (canHandleRoute(PreBuiltUI)) {
return getRoutingComponent(PreBuiltUI)
}
return (
<Router useAuth={useAuth}>
<Set wrap={AppLayout}>
<Route path="/" page={HomePage} name="home" />
</Set>
<Route notfound page={NotFoundPage} />
</Router>
)
} |
@suzdalnitski Thanks for reporting this (and the other issues you've reported!) 🙏 Do you see this issue with both Do you think you could provide a step-by-step reproduction? Preferably without involving supertokens if possible. |
I've pushed a repo that reproduces the issue: https://github.com/suzdalnitski/redwood-auth-bug The only things I've done were: yarn create redwood-app test-app
yarn rw setup auth supertokens
yarn rw dev Then I opened |
It's mutual, thanks for the fast response time! It's a pleasure contributing to an open-source project that is so fast to react (I really dislike contributing to open-source projects that take ages to get back). |
What's not working?
I've added
auth.tsx
toweb/src
. I also have an/auth
route. However, going tolocalhost:8910/auth
serves the raw javascript (ie loads the page), instead of simply updating the route within the frontend app.This seems to be related to this Vite issue: vitejs/vite#3502
I'm not sure if this can be fixed on the Redwood side, but until Vite fixes this issue, it may be worthwhile to add this to documentation (ie avoid having the same name for a file in
web/src
and a route).How do we reproduce the bug?
web/src/auth.tsx
/auth
(this probably is optional)localhost:8910/auth
What's your environment? (If it applies)
No response
Are you interested in working on this?
The text was updated successfully, but these errors were encountered: