sveltejs / kit

web development, streamlined
https://kit.svelte.dev
MIT License
18.44k stars 1.89k forks source link

sveltekit endpoint and form actions not work after deploy to vercel, always return 403. #7239

Closed ubay1 closed 1 year ago

ubay1 commented 1 year ago

??

Conduitry commented 1 year ago

Please provide a minimal but complete reproduction as a link to a repo, as requested in the issue template.

dummdidumm commented 1 year ago

you don't need to make your repo public, you need to provide a minimum reproducible. That means, remove everything from the code that is irrelevant for the bug, which means you probably end up with a src/routes folder with one or two files in it. Then you upload that reproducible as a Github repo or create a Stackblitz project. The given snippets aren't helping because they are incomplete and don't work if copy-pasted, there's too much stuff going on that is left out and probably irrelevant to this issue.

mustofa-id commented 1 year ago

The code is trying to make POST request, whereas the screenshot shows a GET request.

btw, in Vercel web UI, there is Realtime logs ... image

... in Function Logs in your project tab, image

it will log all requests in real time, so you may find details about the error there.

dummdidumm commented 1 year ago

One more time: This isn't a minimum reproducible. You made your repo public - which you don't have to - and in that repo there's a ton of unrelated stuff. Create a new repository which only contains what's needed to reproduce it - copy over your code into that repo and throw everything out that's irrelevant.

Furthermore, a 403 in api/asik/auth sounds like nothing we can help you with. It sounds like you try to access a url in that +server.js and the 403 tells you that you are not allowed to, probably some credentials are missing.

dummdidumm commented 1 year ago

Closing as no minimum reproducible was provided, and the 403 error hints at a problem within the app, rather a bug in SvelteKit