-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Crashes with enabled prerendering #67
Comments
This is not a bug with this library, it's just how sveltekit works. |
I understand that, but could this library just return null just like it does during ssr? Is this a fundamental limitation of sveltekit that cannot be overcome? Perhaps this should've been a feature request rather than a bug report. |
The fact is that this library heavily relies on the page store which is what is throwing that error. So you can't actually access the search Paramus anyway. I'll try to look into your repro to see if there's a specific use case we can try to support but it seems very difficult. Can you talk me more about your use case? |
My usecase is simply that I am using prerendering with hydration (which I would expect to behave similarly to just ssr+hydration). I host my page as static files rather than behind a server. If it's hard to support then nevermind, I will try to workaround it externally, however I have been unsuccessful at that so far. I thought that internally for the lib it's just about slapping an |
The |
I experimented a bit and adding an extra conditions seems to do the trick. Before accessing |
Uh this is actually quite interesting... wasn't aware of the building flag....will experiment and update this issue |
Ok this actually works...let me check when building was introduced to make sure it's not a breaking change and i'll push the changes. |
Describe the bug
When
queryParam
is used on a page that has enabled sveltekit prerendering, the build crashes. This in theory is understandable because obviously there are no query parameters during build. However, I would expect the behavior to be the same as in during SSR: I get null and wait for hydration.Reproduction
Minimal reproduction repo: https://github.com/shilangyu/sveltekit-search-params-prerender
Run
npm run build
to see the problem.Logs
The text was updated successfully, but these errors were encountered: