Skip to content

@sveltejs/adapter-vercel 1.0.0-next.51 breaks production project #4933

@MathiasWP

Description

@MathiasWP

Describe the bug

The "start" method goes from...

start({
	target: document.querySelector('[data-hydrate="16zlsws"]').parentNode,
	paths: {"base":"","assets":""},
	session: {},
	route: true,
	spa: false,
	trailing_slash: "never",
	hydrate: {
		status: 200,
		error: null,
		nodes: [
			import("/_app/pages/__layout.svelte-f2210a94.js"),
				import("/_app/pages/index.svelte-61687a47.js")
		],
		params: {},
		routeId: ""
	}
});

...to...

start({
	target: document.querySelector('[data-hydrate="2eq20f"]').parentNode,
	paths: {"base":"","assets":""},
	session: {token:void 0},
	route: true,
	spa: false,
	trailing_slash: "never",
	hydrate: {
		status: 500,
		error: {name:"Error",message:"Dynamic require of \"tty\" is not supported",stack:"Error: Dynamic require of \"tty\" is not supported"},
		nodes: [
			import("/_app/undefined"),
				import("/_app/pages/__error.svelte-c1882640.js")
		],
		params: {},
		routeId: ""
	}
});

when updating the vercel adapter from next.50 to next.51.

This change triggers the following error message when trying to open up the project in production.

Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: https://my-website.vercel.app/_app/undefined

Reproduction

Here's a MVP that will break in production with adapter.51, but will work with adapter.50: https://github.com/MathiasWP/vercel-adapter-bug-reproduction

The project has 2 branches, main with adapter next.51, and a branch called adapter.50 with the next.50 version.

Here is a deployed version with the next.50 adapter (working): https://vercel-adapter-bug-reproduction-mps8glry7-mathiaswp.vercel.app/
And here is the exact same application with the next.51 adapter (not working): https://vercel-adapter-bug-reproduction.vercel.app/

Logs

No response

System Info

System:
    OS: macOS 11.4
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
    Memory: 23.68 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 8.1.0 - /usr/local/bin/npm
  Browsers:
    Brave Browser: 101.1.38.111
    Chrome: 101.0.4951.64
    Edge: 101.0.1210.47
    Firefox: 100.0
    Safari: 14.1.1
  npmPackages:
    @sveltejs/adapter-vercel: ^1.0.0-next.51 => 1.0.0-next.51 
    @sveltejs/kit: 1.0.0-next.330 => 1.0.0-next.330 
    svelte: ^3.46.0 => 3.48.0

Severity

blocking an upgrade

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions