-
Notifications
You must be signed in to change notification settings - Fork 1k
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?]: 404 on paths containing periods #9969
Comments
I think it's similar, yes, but I raised a separate issue since that one is specifically discussing query params, where we're seeing the problem directly in the path. I also wasn't sure whether that issue had been addressed, since it's still open but I also see #9714. |
I originally thought #9272 caused this, but I realize now that that was released in 6.3.3, and this issue is not present yet even on 6.5.1 (which we reverted to as a workaround). So now I see that this problem was introduced in 6.6.0 -- perhaps indeed by #9714, which was released then with intent to fix #9663. |
I see this has been labeled a confirmed bug. Is there a way to override this behavior in the meantime, or will we have to stick to 6.5.1 until this can be resolved directly? I don't have sufficient context on the changes that caused this issue, so at the moment I'm not sure I could suggest a fix other than to revert the changes entirely, which would presumably break (new?) intended behavior. |
Could you use some other delimiter than a period? |
For context, there was a change in some extension detection that makes periods act like an extension delimiter:
Thus the route could be not found when parsed. |
Unfortunately we have a live production application with existing usernames and profile pages I don't think we're planning to change, so for now we'll probably have to just stick to 6.5.1 until this is resolved.
This seems like a rather significant breaking change for a minor. I'm not sure I understand why this was necessary to do at such a global scope rather than at e.g. a particular (configurable?) base path, but in any case, we don't want this behavior (at least not globally), so hopefully there will be a way to opt in or out at some point. |
We're pretty motivated to stay current on Redwood and we're eager to take advantage of RSC/SSR when the time comes, but we can't upgrade past 6.5.1 while this bug remains. What can I do to help get this resolved? Can the change that introduced this be reverted, or is there a clear direction for how to fix this while retaining whatever functionality drove that change? |
I'll take a look at this tomorrow. I haven't been following along, so first I will have to get up to speed on things. Then I'll let you know how we'll handle this |
Yeah, this was/is not how we'd label this had we realized this would be the effect. Redwood definitely needs to support dots in the url path, just like you have it. I'll have to do a deeper dive to figure out exactly how to fix this, but it should definitely be fixed somehow. So next step here is for me to get a reproduction up locally (thanks for providing the steps on how to do so!) and then start looking into a solution. I'll try to get to it tomorrow (Monday) or early Tuesday. After that I'll be traveling. |
Sorry, bad news. This is a bug in vite 🙁 It's fixed in Vite 5, but we can't upgrade because we don't fully support ESM yet, and Vite 5 dropped CJS support. However that only explains it for |
For the redwood/packages/adapters/fastify/web/src/web.ts Lines 87 to 95 in 0b1b4c6
Worth noting also that this is only an issue if the part of the url that can have a period is last. So, from the repo example in the issue description:
This will work
|
@pvenable A potential fix for this was released in v7.0.7. Could you please try that version and report back if it works for you? |
@Tobbe Thanks for the fix! I'll report results as soon as I can as I'm currently working through other issues upgrading to v7, some of which don't seem to be referenced in the upgrade guide. Completely off topic for this issue but I'm getting errors with graphql fragments while attempting to upgrade, so first I need to figure out if it's a Redwood issue or a conflict specific to our codebase. I can open a new issue if it's the former, but just for context I'm getting errors wherever we're including fragments into other queries/fragments roughly like: const fragment = gql`
fragment ExampleFragment on Whatever {
id
...SomeOtherComponentFragment
}
${SomeOtherComponent.fragments.foo}
` with error messages like I also see this error in my editor when navigating to the (It looks like the Anyway, apologies for going off-topic here. I'll probably open an issue for this if I don't get it resolved soon. |
I've opened an issue (with repro) for the graphql fragment error above in #10120, but I look forward to testing the path fix once I can upgrade our app. Thanks again! |
@Tobbe I'm happy to report that the v7.0.7 release appears to resolve the paths-with-periods issue (outside of the dev server). 🎉 I understand that the issue persists with Thanks for the resolution! |
What's not working?
We're seeing 404s instead of
index.html
for paths containing periods, e.g.https://example.com/foo/bar.baz
. Our app has profile handles that can include periods and that are used directly in urls like this.I'm investigating whether we have any way to override this, so if there's a known workaround, that would be great to hear. This is a live production issue for us right now.
We're also seeing evidence that reverting to Redwood 6.5.1 or so might work as a temporary solution.
How do we reproduce the bug?
Create a new redwood app and generate a page:
Update
web/src/Routes.tsx
so the path contains a period:Run the app:
or if you prefer
Visit http://localhost:8910/test.profile
Expected result: Test page renders
Actual result: 404 Not Found
What's your environment? (If it applies)
Are you interested in working on this?
The text was updated successfully, but these errors were encountered: