Skip to content
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

afterUpdate in the root sveltekit component is not called after a failing action #11027

Closed
paoloricciuti opened this issue Nov 13, 2023 · 0 comments · Fixed by #11028
Closed
Labels

Comments

@paoloricciuti
Copy link
Member

paoloricciuti commented Nov 13, 2023

Describe the bug

The effect of this is that if you fail an action on a form that is using enhance the page store doesn't update. It might have other repercussions.

Reproduction

  • go to https://www.sveltelab.dev/4zr9147ftt14ndq
  • follow the link in the index
  • try to submit the form
  • observe that the page store update
  • go to ./src/[test]/+page.server.ts and swap line 18 and 19 (return fail instead of actual data)
  • try to submit the form again
  • observe that the page store doesn't update

Reproduction 2

I was able to come up with an even more minimal reproduction in the svelte 5 repl

  • Go here
  • click on the button "Change store"
  • observe that the prop update in the console but there's no afterUpdate log happening

Logs

No response

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.4.2 - /usr/local/bin/npm
    pnpm: 8.9.2 - /usr/local/bin/pnpm
  npmPackages:
    @sveltejs/adapter-auto: ^2.1.1 => 2.1.1 
    @sveltejs/kit: ^1.27.4 => 1.27.5 
    svelte: next => 5.0.0-next.1 
    vite: ^4.5.0 => 4.5.0

Severity

blocking an upgrade

Additional Information

The reason why i can say that afterUpdate is not called is because i started debugging this and went into chrome sources and added some breakpoints in the root sveltekit component.

Specifically i've added a breakpoint in the $effect.pre that reads the store and call set on the page store and a breakpoint inside the afterUpdate

dummdidumm added a commit that referenced this issue Nov 13, 2023
- fixes #11027 (not the underlying issue, but the problem within SvelteKit)
- fixes #11022
dummdidumm added a commit that referenced this issue Nov 14, 2023
- fixes #11027 (not the underlying issue, but the problem within SvelteKit)
- fixes #11022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants