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

404 Error when deploying to Vercel #3142

Closed
HeritagePalms opened this issue Dec 30, 2021 · 6 comments
Closed

404 Error when deploying to Vercel #3142

HeritagePalms opened this issue Dec 30, 2021 · 6 comments
Labels
bug Something isn't working pkg:adapter-vercel Pertaining to the Vercel adapter
Milestone

Comments

@HeritagePalms
Copy link

Describe the bug

With the new API changes that were done (#3133), the new output folder is '.output' instead of '.vercel_build_output' and Vercel doesn't seem to know what to do with that.

I have the preset set to Sveltekit and had to do a manual override on the output folder to '.vercel_build_output' for it to work. Now, I followed the Vercel guide for the file system api (https://vercel.com/docs/file-system-api), and my deployments just go to a 404 page. I also added the manual output override to '.output' but the deployments fail if I do that.

I understand that this might be a Vercel thing instead of SvelteKit. If so, then let me know and I will head over there.

Thanks.

Reproduction

I don't have a public repo available, sorry.

Logs

No response

System Info

System:
    OS: macOS 12.1
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Memory: 100.13 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.0 - /usr/local/bin/node
    npm: 7.17.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 96.0.4664.110
    Edge: 96.0.1054.62
    Firefox Developer Edition: 96.0
    Safari: 15.2
  npmPackages:
    @sveltejs/adapter-vercel: next => 1.0.0-next.33 
    @sveltejs/kit: ^1.0.0-next.114 => 1.0.0-next.208 
    svelte: ^3.34.0 => 3.44.3

Severity

blocking an upgrade

Additional Information

No response

@Rich-Harris
Copy link
Member

same issue as #3143, closing (even though this was first :)

@Rich-Harris
Copy link
Member

actually this might not be a dupe, reopening

@Rich-Harris Rich-Harris reopened this Dec 30, 2021
@HeritagePalms
Copy link
Author

HeritagePalms commented Dec 30, 2021

I don't know if this helps but overriding the output folder in Vercel deployment settings allows the build to complete but the root folder structure in Vercel is just a 'server' and 'static' folder & 'routes-manifest.json' file. So my guess is that it doesn't know where the app starts, hence the 404 page.

@benmccann benmccann added this to the 1.0 milestone Dec 30, 2021
@benmccann benmccann added bug Something isn't working pkg:adapter-vercel Pertaining to the Vercel adapter labels Dec 30, 2021
@Rich-Harris
Copy link
Member

Can you try with @sveltejs/adapter-vercel@1.0.0-next.34?

@HeritagePalms
Copy link
Author

@sveltejs/adapter-vercel@1.0.0-next.34

This indeed solve my problem. Thanks!

@hemanthvalsaraj
Copy link

hemanthvalsaraj commented Jan 12, 2022

This ain't working for me either. Am I missing something here?

package.json
{ "@sveltejs/adapter-vercel": "next", "@sveltejs/kit": "next", "svelte": "^3.44.0", "svelte-preprocess": "^4.10.1", }

Error Log on Vercel
`

Using @sveltejs/adapter-vercel
Cannot read property 'location' of undefined
at get_single_valued_header (file:///vercel/path0/node_modules/@sveltejs/kit/dist/chunks/url.js:8:23)
at visit (file:///vercel/path0/node_modules/@sveltejs/kit/dist/chunks/index5.js:436:22)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Command "yarn run build" exited with 1
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:adapter-vercel Pertaining to the Vercel adapter
Projects
None yet
Development

No branches or pull requests

4 participants