You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using getStaticProps and linking to a local JSON file (exporting static), I notice that if your path has trailing slash plus a query parameter (ex: my.path.com/subpath/?query=1), pathname gets broken and fail to request data.
Navigate to a page with a trailing slash at the end and add a query parameter after that (ex: my.path.com/subpath/?query=1)
See error
Expected behavior
NextJs should handle this path behavior even it's not that common.
System information
OS: macOS
Browser chrome
Version of Next.js: [e.g. 9.1.7-canary.16]
Additional context
Just a small edge case fix.
I know this still a concept, but it looks like is an easy fix. I solved changing (temporary) my local nextjs code at file lib/router/router.js and changed line 63 (inside the function _getStaticData from this:
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.
vercel
locked as resolved and limited conversation to collaborators
Jan 30, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Describe the bug
Using
getStaticProps
and linking to a local JSON file (exporting static), I notice that if your path has trailing slash plus a query parameter (ex: my.path.com/subpath/?query=1), pathname gets broken and fail to request data.To Reproduce
getStaticProps
with external fetch (like Static generation https://github.com/zeit/next.js/blob/canary/docs/concepts/_data-fetching.md)next export
Expected behavior
NextJs should handle this path behavior even it's not that common.
System information
Additional context
Just a small edge case fix.
I know this still a concept, but it looks like is an easy fix. I solved changing (temporary) my local nextjs code at file
lib/router/router.js
and changed line 63 (inside the function_getStaticData
from this:to:
The text was updated successfully, but these errors were encountered: