-
Notifications
You must be signed in to change notification settings - Fork 41
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
NextJS: PageRouter issue using direct URL #727
Comments
@UbiquitousBear have you read the section on SPA: https://docs.quarkiverse.io/quarkus-quinoa/dev/advanced-guides.html#spa-routing See both the NOTE and the WARNING. |
To clarify, I'm using the |
Yeah I am wondering the same thing. Any way you can try it out or put together a small runnable reproducer? |
This comment was marked as off-topic.
This comment was marked as off-topic.
@melloware I've enabled SPA routing, whilst I can't isolate the example (simply due to lack of time this week), I am more than happy to push the whole thing to a private GH repo if that helps? |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@UbiquitousBear try this. Unzip and run This proves Quinoa and SPA is working. you might want to check if its all that Atlassian Code or other things you have going on in your complex project. |
@melloware if you navigate directly to http://localhost:8080/post/2020/first-post/with/catch/all/routes in your browser, does it still work? When I go to that URL directly, I see:
|
This comment was marked as outdated.
This comment was marked as outdated.
Interesting so when you click the link here is what Next Generates:
Which is not the same as
|
Assigned to @ia3andy i am not quite sure how this route is being lost. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as outdated.
This comment was marked as outdated.
Here is what I have debugged:
This websocket message back from Next is interesting.
|
Line 3, why is quinoa rerouting to /? |
@UbiquitousBear its explained right here: https://docs.quarkiverse.io/quarkus-quinoa/dev/advanced-guides.html#spa-routing It looks like its successfully being sent to Next. But the response from Next is not the page it looks like somehow it stays routed to |
Could this be a nextjs bug? But wonder why it can't be reproduced using the dev server.... |
I don't think so i think its just a matter of figuring out why Quinoa SPA handler is not handling NextJS 14 AppRouter. I used to have it working it older NextJS versions I think 12. But AppRouter is newer and NextJS seems to be changing every day. |
To clarify, the example (and where I'm see the issue) uses the Pages Router, not the App Router... |
I see a mention of hydration, are you sure there is no server side rendering in there? |
what are you defining as hydration? Hydration is happening at some level, always does in React applications. |
@UbiquitousBear AFAIK hydration is happening only when the server is doing part of the work which is not the case for plain SPA no? |
That's one definition of hydration when applied to the App Router. Hydration as-is, in client side generated apps still refers to attaching event listeners to the static HTML, making it dynamic at some level. https://github.com/vercel/next.js/blob/cf62dccd850ce48429955463205dd0105e83ddbd/packages/next/src/client/index.tsx#L569 is calling the |
@melloware ant luck with this, it’s slowly becoming a blocker, but I can’t also be the only one with this issue? |
see this discussion: #788 @zZHorizonZz looked into this and he is running into the same conclusions we are. |
Describe the bug
When I navigate directly to any non-root URL e.g.
http://localhost:8080/components/[id]
orhttp://localhost:8080/components/
, the contents ofhttp://localhost:8080/
(iesrc/pages/index.tsx
is shown. If it try the same request over the nextjs dev server directly, iehttp://localhost:3000/components/[id]
the routing works as expected.Inspecting the state of
next/router
shows that the path is picked up, but nothing else is. Unsure whether this is a next issue or a quinoa issue.Quinoa version
2.4.3
Quarkus version
3.12.3
Build / Runtime
Next.js
Package Manager
PNPM
Steps to reproduce the behavior
next14-quinoa.zip
Unzip and run
mvn quarkus:dev
and navigate tohttp://localhost:8080
it uses Next App Router and the dynamic slugs work fine.However naivgate directly to
http://localhost:8080/post/2020/first-post/with/catch/all/routes
and it loses the route.Expected behavior
No response
The text was updated successfully, but these errors were encountered: