-
Notifications
You must be signed in to change notification settings - Fork 27k
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
getServerSideProps data urls don't respect assetPrefix #11992
Comments
Yep, exactly the same is happening here. I can confirm that locally works fine, the Is this the same behavior you're observing @chrisbrantley ? |
@tmayr Yes, that appears to be the behavior I'm seeing. It appears when the client-side request to the data url fails Next.JS falls-back to reloading the entire page to get the server-side-rendered version. So in this case the app still sort of "works" but it's not a good experience and not efficient. I'm hoping this was just an oversight in implementing these data urls for client-side fetching of server-side props. |
To add to this i'm seeing the same behaviour with data urls not being prefixed using |
Poking about with the code (i'm no expert in the codebase), here seems to be the culprit: Which seems to add an experimental A quick addition of the assetPrefix to this line fixes my problem (with an ssg site using |
@daveskybet have you solved this issue? I am experiencing the same thing |
@davscro No, I ended up not needing Are you needing |
Hi @daveskybet, Yes, you were right. I do not need assetPrefix only basePath is enough and nginx location directive. Now everything works perfectly. Thanks for the hint. 👍🏼 |
Please use the new |
@Timer In our case, this is not possible. The basePath is expecting a subfolder, and we want to use a subdomain. Can this issue be reopened or do you want me to create a new one? |
We have tested on our website and basePath is not suitable for our settings : |
I need the |
Started a discussion here to try and find a fix for the problems created by this change #25681 |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
I have assetPrefix set because we are hosting multiple applications on the same domain and use a proxy to route paths.
assetPrefix = "reports"
The static asset urls are correct. Such as
/reports/_next/static/development/pages/_app.js?ts=1587171521639
.However, the data fetching URLs are NOT including the prefix:
/_next/data/development/reports/appointments/2020-03-18/2020-04-17.json
.To Reproduce
getServerSideProps
Expected behavior
I would expect the assetPrefix to apply to ALL asset urls that start with
_next/
The text was updated successfully, but these errors were encountered: