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

how to handle formdata with endpoints #17

Closed
bitdom8 opened this issue Jul 4, 2023 · 5 comments · Fixed by #47
Closed

how to handle formdata with endpoints #17

bitdom8 opened this issue Jul 4, 2023 · 5 comments · Fixed by #47

Comments

@bitdom8
Copy link

bitdom8 commented Jul 4, 2023

Got error: FormData parse error missing final boundary

login: async ({ cookies, request, locals }) => {   
49 |     let res;
50 |     try {
51 |       await db.use({ ns: "xx", db: "xx" });
52 |       const formData = await request.formData();     
                                 ^
TypeError: FormData parse error missing final boundary    
      at /usr/local/lsws/nodes/xx/build/server/entries/pages/_lang_/_page.server.ts.js:52:29

https://kit.svelte.dev/docs/form-actions

@bitdom8
Copy link
Author

bitdom8 commented Jul 5, 2023

After debugging, still getting FormData parse error missing final boundary and it's not related to endpoints. Searched here but couldn't understand oven-sh/bun#621

@bitdom8
Copy link
Author

bitdom8 commented Jul 6, 2023

Even tried this but no success sveltejs/kit#6901 @gornostay25

@bitdom8
Copy link
Author

bitdom8 commented Aug 3, 2023

Managed dto have a different bun running outside of sveltekit then was able. Sveltekit makes things hard with cross-side. Even tried node-adaptor

@bottrall
Copy link

It looks like this isn't only affecting sveltekit/sveltekit-bun-adaptor, oven-sh/bun#2644.

@Paultje52
Copy link

Paultje52 commented Dec 10, 2023

Recently I encountered the same issue. It started when updating from 0.5.0 to 0.5.1. I'm using bun 1.0.4 because of another issue.

Here is a basic project to reproduce the error. Edit the import in svelte.config.js to see that it's working in 0.5.0, but not in 0.5.1.
svelte-adapter-bun-formdata.zip

Note: In the example I'm using @catdadcode/svelte-adapter-bun because of #39, however with the solution Dan1ve provided the issue is also reproducable in 0.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants