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

errors exported by +page.svelte is only available on the server and not on the client #5906

Closed
pilcrowonpaper opened this issue Aug 16, 2022 · 4 comments · Fixed by #5918
Closed
Labels
bug Something isn't working

Comments

@pilcrowonpaper
Copy link

pilcrowonpaper commented Aug 16, 2022

Describe the bug

Cannot access the errors object in the client returned by actions (+page.server.js).

Reproduction

https://github.com/pilcrowOnPaper/sveltekit-action-issue

Description and steps are described in the repo README

Logs

(Browser console)

<Root> was created without expected prop 'errors'

System Info

System:
    OS: macOS 12.5
    CPU: (8) x64 Intel(R) Core(TM) i7-1060NG7 CPU @ 1.20GHz
    Memory: 870.41 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
Binaries:
    Node: 18.7.0 - ~/.nvm/versions/node/v18.7.0/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.15.0 - ~/.nvm/versions/node/v18.7.0/bin/npm
Browsers:
    Chrome: 98.0.4758.102
    Firefox: 103.0.2
    Safari: 15.6
npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.64
    @sveltejs/kit: next => 1.0.0-next.408
    svelte: ^3.44.0 => 3.49.0
    vite: ^3.0.0 => 3.0.7

Tested with: Safari, Firefox, Chrome

Severity

blocking an upgrade

Additional Information

No response

@rmunn
Copy link
Contributor

rmunn commented Aug 16, 2022

#5875 is relevant here: POST in +page.server.js is going to be moving to +actions.server.js and changing its name, along with a lot of other changes; see that discussion for full details.

@pilcrowonpaper
Copy link
Author

pilcrowonpaper commented Aug 16, 2022

@rmunn Is this expected behavior? If this is a bug, I found the cause and can open a PR.

@rmunn
Copy link
Contributor

rmunn commented Aug 16, 2022

@pilcrowonpaper I don't think this behavior is expected, so go ahead and open the PR if you've already got a bugfix ready and it's small. But since according to #5875 the relevant parts of the code will be changing soon, if your PR is large it may end up with a lot of merge conflicts and it might be worth holding off until #5875 gets implemented. If it's small, though, might as well get it in now so the bugfix can be incorporated into the upcoming #5875 changes.

@pilcrowonpaper
Copy link
Author

It's just 3 lines of code, will open a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants