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

adapter-vercel deployment error with split: true option #7723

Closed
opensas opened this issue Nov 19, 2022 · 1 comment · Fixed by #7741
Closed

adapter-vercel deployment error with split: true option #7723

opensas opened this issue Nov 19, 2022 · 1 comment · Fixed by #7741
Labels
bug Something isn't working pkg:adapter-vercel Pertaining to the Vercel adapter
Milestone

Comments

@opensas
Copy link

opensas commented Nov 19, 2022

Describe the bug

When deploying a sveltekit project with the adapter-vercel and split: true option in svelte.config.js, deployment failes with the following message:

> Using @sveltejs/adapter-vercel
  ✔ done
Build Completed in /vercel/output [6s]
An unexpected error happened when running this build. We have been notified of the problem. If you have any questions, please contact [email protected].

Reproduction

$ pnpm create svelte@latest vercel-split-test

✔ Which Svelte app template? › Skeleton project
✔ Add type checking with TypeScript? › Yes, using TypeScript syntax
✔ Add ESLint for code linting? No
✔ Add Prettier for code formatting? No
✔ Add Playwright for browser testing? No

create repo at github

cd vercel-split-test
git init
git add .
git commit -m "first commit"
git branch -M main
git remote add origin [email protected]:opensas/vercel-split-test.git
git push -u origin main

Import project to vercel with default options

Add "@sveltejs/adapter-vercel": "next" to the devDependencies in your package.json and run pnpm install

update svelte.config.js like this:

import adapter from '@sveltejs/adapter-vercel';
import preprocess from 'svelte-preprocess';

/** @type {import('@sveltejs/kit').Config} */
const config = {
	// Consult https://github.com/sveltejs/svelte-preprocess
	// for more information about preprocessors
	preprocess: preprocess(),

	kit: {
		adapter: adapter({
			split: true
		})
	}
};

export default config;

Commit and push changes

Logs

with split: true failed deploy:

[23:05:37.074] Cloning github.com/opensas/vercel-split-test (Branch: main, Commit: 85e0833)
[...]

devDependencies:
+ @sveltejs/adapter-auto 1.0.0-next.88
+ @sveltejs/adapter-vercel 1.0.0-next.81
+ @sveltejs/kit 1.0.0-next.551
+ svelte 3.53.1
+ svelte-check 2.9.2
+ svelte-preprocess 4.10.7
+ tslib 2.4.1
+ typescript 4.9.3
+ vite 3.2.4

Done in 3.3s
Running "pnpm run build"

> [email protected] build /vercel/path0
> vite build

vite v3.2.4 building for production...
transforming...
✓ 35 modules transformed.
rendering chunks...
vite v3.2.4 building SSR bundle for production...
transforming...
✓ 54 modules transformed.
Generated an empty chunk: "hooks"
rendering chunks...
.svelte-kit/output/server/vite-manifest.json                   1.39 KiB
.svelte-kit/output/server/index.js                             96.18 KiB
.svelte-kit/output/server/entries/fallbacks/layout.svelte.js   0.23 KiB
.svelte-kit/output/server/entries/fallbacks/error.svelte.js    1.50 KiB
.svelte-kit/output/server/entries/pages/_page.svelte.js        0.31 KiB
.svelte-kit/output/server/chunks/index.js                      3.15 KiB
.svelte-kit/output/server/chunks/hooks.js                      0.00 KiB

Run npm run preview to preview your production build locally.
.svelte-kit/output/client/vite-manifest.json                                         2.78 KiB
.svelte-kit/output/client/_app/immutable/components/layout.svelte-5d5c2819.js        0.53 KiB / gzip: 0.35 KiB
.svelte-kit/output/client/_app/immutable/components/error.svelte-0f9e2f60.js         2.07 KiB / gzip: 0.95 KiB
.svelte-kit/output/client/_app/immutable/components/pages/_page.svelte-aa58de35.js   0.81 KiB / gzip: 0.47 KiB
.svelte-kit/output/client/_app/immutable/chunks/singletons-1aa68ebc.js               1.99 KiB / gzip: 1.07 KiB
.svelte-kit/output/client/_app/immutable/chunks/0-000c53bf.js                        0.09 KiB / gzip: 0.09 KiB
.svelte-kit/output/client/_app/immutable/chunks/1-632860ef.js                        0.09 KiB / gzip: 0.09 KiB
.svelte-kit/output/client/_app/immutable/chunks/2-234451a5.js                        0.09 KiB / gzip: 0.10 KiB
.svelte-kit/output/client/_app/immutable/chunks/index-4ce6debf.js                    6.71 KiB / gzip: 2.72 KiB
.svelte-kit/output/client/_app/immutable/start-745d8c8c.js                           26.54 KiB / gzip: 10.21 KiB

> Using @sveltejs/adapter-vercel
  ✔ done
Build Completed in /vercel/output [6s]
An unexpected error happened when running this build. We have been notified of the problem. If you have any questions, please contact [email protected].

with split: false deploy succeeded:

[...]
.svelte-kit/output/server/chunks/index.js                      3.15 KiB
.svelte-kit/output/server/chunks/hooks.js                      0.00 KiB
  ✔ done
Build Completed in /vercel/output [10s]
Generated build outputs:
 - Static files: 12
 - Serverless Functions: 1
 - Edge Functions: 0
Serverless regions: Washington, D.C., USA
Deployed outputs in 2s
Build completed. Populating build cache...
Uploading build cache [12.14 MB]...
Since the Node.js version () or package manager  could not be determined, Build Cache will not be stored
Done with "."

System Info

System:
    OS: Linux 5.4 Ubuntu 18.04.6 LTS (Bionic Beaver)
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    Memory: 7.62 GB / 15.08 GB
    Container: Yes
    Shell: 4.4.20 - /bin/bash
  Binaries:
    Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
    npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm
  Browsers:
    Brave Browser: 107.1.45.127
    Chrome: 107.0.5304.110
    Firefox: 107.0
  npmPackages:
    @sveltejs/adapter-vercel: next => 1.0.0-next.81 
    @sveltejs/kit: next => 1.0.0-next.551 
    svelte: ^3.44.0 => 3.53.1 
    vite: ^3.1.0 => 3.2.4

Severity

serious, but I can work around it (just set split: false)

Additional Information

public github repo with the issue and detailed steps to reproduce it: https://github.com/opensas/vercel-split-test#steps-to-reproduce

@dummdidumm dummdidumm added the pkg:adapter-vercel Pertaining to the Vercel adapter label Nov 19, 2022
@Rich-Harris Rich-Harris added this to the 1.0 milestone Nov 20, 2022
@Rich-Harris Rich-Harris added the bug Something isn't working label Nov 20, 2022
dummdidumm added a commit that referenced this issue Nov 21, 2022
Rich-Harris pushed a commit that referenced this issue Nov 21, 2022
* [fix] handle root route for split config

Fixes #7723

* always remove leading slash
@opensas
Copy link
Author

opensas commented Nov 22, 2022

I can confirm that now it's working fine, great work as usual!

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

Successfully merging a pull request may close this issue.

3 participants