-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Possible bug: Inconsistent behavior with Node 20 #26
Comments
Start a new pull request in StackBlitz Codeflow. |
Mmm in the stackblitz you sent is completely normal that no request is made...are you saying that if you upgrade to node 20 the load function will run on every keystroke? That seems like a sveltekit bug more than a sveltekit-search-params bug but i'll take a look...in the meantime please can you confirm this? |
Yes that's correct, sorry for the confusion. I couldn't find a way to get stackblitz to use node 20. For example, the project im working on had been on Node 18 and it was fine. But at some point my docker image updated to Node 20 and that's when the issue began. Forcing docker to node 18 fixes the problem. |
I can confirm this is actually a bug with sveltekit...do you prefer to open this issue on the kit repository? Otherwise i can do it for you. |
If you don’t mind maybe you can, if you have clean repro steps. It seems more important coming from a plugin maintainer such as yourself. |
Sure i'll prepare a repro and open an issue on kit...thanks for reporting |
Uh i can't reproduce anymore even with node 20 and your code |
If I run |
You can just |
OK I figured out how to repro. You need to check the URL in page.server.ts and it somehow becomes aware of that. Change the handler to something like this: export const load = ({url}) => {
const now = new Date().toString();
if(url.searchParams.has('a')) {
console.log('noop');
}
console.log(now);
return { now };
}; I can't get it to not happen, even switching back to node 18 in gitpod, downgrading sveltekit, etc. Its weird that this doesn't happen when I use the docker image 18-alpine, because the server handler is the exact same. |
If you do this than it's the actual expected behavior of sveltekit...if you use searchParams inside the load function it will invalidate and rerun when the search params change |
Describe the bug
First off, I'll say that I haven't verified if this happens without the use of your plugin.
Running this on Node 18, no calls to __data.json happen when typing in the input. But when I upgrade to Node 20, I see a request to __data.json on every keystroke.
It took me a looong time to figure out what the culprit was. I created a whole Stackblitz for you, only to find that the issue wasn't there because apparently it runs Node 16.
Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-d1rzdh?file=README.md
Logs
No response
The text was updated successfully, but these errors were encountered: