Replies: 7 comments 8 replies
-
We've landed experimental support for basePath here: #9872 it should help a bit with Do note this is experimental so not as stable as features on the main release line. |
Beta Was this translation helpful? Give feedback.
-
Thanks! It helped solve some problems. So following your answer:
Also realized that I was doing the router push wrong so:
App works, every page loads and info can be retrieved from the api but I now have a new problem. Any page change causes a complete re-render. So styles are refetched, queries as well, everything is download again. Basically all SPA behavior is lost. Could this be because of the link prefetching disabled? |
Beta Was this translation helpful? Give feedback.
-
So have tried different nginx configs, but the app keeps rerendering an every page url change. Feel like it is coming from NextJS. Is there any header that has to be passed to avoid this rerendering? Or how is it determined when to rerender? |
Beta Was this translation helpful? Give feedback.
-
Yes, it does result in a 404 error and looking at the request url I see the basePath included in two places. Here an example:
Is this meant to be? Will never find the bundle there since that path doesnt exist in the app |
Beta Was this translation helpful? Give feedback.
-
Trying to use nginx rewrites to remove the basePath from the urls:
And its now loading the JS bundle but unable to route to any other page. So now clicking any button fetches the js bundle but nothing else happens |
Beta Was this translation helpful? Give feedback.
-
Found the reason. Was on my side. I was manually adding the basePath to the Link url and forgot to remove it after the update to 9.3.5 (which adds it). Still when going from on route Had to add the as parameter to the Link component such as |
Beta Was this translation helpful? Give feedback.
-
Hi, yeah it wasn't removing the basePath when fetching the next page or prefetching links. This is the repo: https://github.com/apotdevin/thunderhub This line https://github.com/apotdevin/thunderhub/blob/f29ba3d2ae0337de8311cd835f973c1aef08ab40/src/components/link/Link.tsx#L81 before was |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
So I am trying to deploy a nextjs app with a graphql api endpoint (Docker image) behind nginx with a different base path and running into different issues.
First as some context, the basePath im testing is
zone
and this is the nginx config:Have added the base path to different parts in the app. For example:
Also I have fonts and images inside the
/public
folder.When I deploy the application, routes are working but still have multiple issues.
zone
at the beggining and end:http://test.domain.com/zone/_next/static/gIl8N0aYX2uecNphmmgCU/pages/zone/user.js
Any idea or suggestion to get this working would be awesome and will also update if I have any progress
Beta Was this translation helpful? Give feedback.
All reactions