-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
goto() fails if conditional #10441
Comments
Just curious, does calling |
@Proziam FYI for our app, Kit version 1.22.6 the problem you describe occurs even when outside of a conditional block, and your workaround still cures it. What is very odd is that we've been using SvKit since before 1.0 and have many, many uses of @themajashurka For us, the |
@themajashurka When I was debugging this on our app tick didn't solve the issue. @netaisllc I tested out most of the "solutions" I found when I was trying to debug this and the one I posted is the only one that worked on every test case I wrote. I haven't seen this issue outside of a conditional block yet though, so my app clearly isn't covering all the test cases. I agree, this feels like a weird regression. |
This issue still persists on the latest version of svelte/kit (2.5.5) Symptoms unchanged, still doesn't throw an error of any sort. Still fixing the issue with: export const navigate = (url: string) => {
setTimeout(() => goto(url), 0);
} |
I've never used Tauri before and have no idea how it works. It would be very helpful if you provide a minimal reproduction so that it's possible to diagnose the issue. |
I've spent the last hour or so trying to make a repro without success. However, symptoms seem consistent with those described in this issue - sveltejs/svelte#6732. FWIW, we've run into all of the same issues described in that thread, particularly with stores. As for what Tauri is, it's running npm run build and then simply serving the website through the OS's native browser to make it function like a desktop app. |
Describe the bug
Using Tauri to build a desktop application I noticed that goto() doesn't work whenever it's called upon conditionally. If you put a console.log() above it, the console.log() does fire, and returns the expected value to indicate that goto() should also fire.
I found a workaround on reddit:
setTimeout(() => goto('/profile/name'), 0);
which does work.Reproduction
Apologies for the lack of proper reproduction. You can find other users describing the issue in this thread along with a code sample: https://www.reddit.com/r/sveltejs/comments/10o7tpu/sveltekit_issue_goto_not_working_on_ios/
WORKS
DOES NOT WORK
Logs
No errors are shown, console.log() tests all show that the code is functioning as intended.
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: