paoloricciuti / sveltekit-search-params

The easiest way to read and WRITE from query parameters in sveltekit.
https://sveltekit-search-params.netlify.app
MIT License
497 stars 15 forks source link

Potential uncaught error message? #23

Closed danielimmke closed 1 year ago

danielimmke commented 1 year ago

Describe the bug

Hello,

We've chatted before. Thanks again for creating this super helpful package. I'd donate to you if there was an option for it (is there?)

I wanted to report something I have been getting in my logs on any page that uses this package. I checked the stack trace and it appears that goto is being called a total of 4 times in the main sveltekit-search-params.js file. It's possible I have things setup in an unusual way where SvelteKit tries to execute this code on the server - I have a lot of logic about how navigation happens in my app. This happens on a page where I use debounceHistory and a page where I don't.

I'm not sure I will be able to repro it, but I will try later today. But I think adding a if(browser) guard before the goto calls would maybe fix the issue? Even if it's not something that only occurs in edge cases.

Screenshot 2023-04-20 at 8 53 49 AM

Reproduction

N/A

Logs

No response

paoloricciuti commented 1 year ago

Hi thank you for submitting the issue and add the PR to fix it. I've merged the PR and i'll publish a new version soon.

As for the donation i've setup my profile to receive donations and you did remember me to add the funding button so if you really really really want to donate i appreciate. But let's be clear, you don't have to: i did this because i love OSS and didn't expect anything in return.

Thanks for your time and glad you like the package.