$page.query returns empty on prerendered pages
See original GitHub issueDescribe the bug Using $page.query sometimes returns as empty for pages with a query string.
To Reproduce
In my experience, any basic page using page
from the store.
Expected behavior It should always have the current page query string
Severity
It made this feature currently unusable for me.
In my case, I can check with browser
and use window.location.search
instead.
But I’m not sure how severe this might be for those relying on it in the backend.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
General tips and best practices - Troubleshooting - Prerender.io
Prerender gives back raw or empty content. If the prerender returns an X-Prerender-Raw-Data header, the crawler cannot render the page and ...
Read more >Next.js router.query getting undefined on refreshing page, but ...
During prerendering, the router's query object will be empty since we do not have query information to provide during this phase.
Read more >Using Prerender.io and avoiding prerender of nonexistent pages
The issue is this is causing a bunch of blank pages to be pre-rendered as it seems random bots keeps trying to access...
Read more >Data Fetching: getStaticProps - Next.js
Fetch data and generate static pages with `getStaticProps`. ... Next.js will pre-render this page at build time using the props returned by getStaticProps...
Read more >Prerender | RedwoodJS Docs
This error happens during builds when you have a Cell on a page you're prerendering that makes a query marked with @requireAuth in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is the same thing I’m experiencing, but I’m using adapter-static.
This happens when the page is prerendered. Closing as duplicate of https://github.com/sveltejs/kit/issues/669