question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

adapter-vercel build fail - app.js missing

See original GitHub issue

Describe the bug

After upgrading packages project no longer builds with vercel adapter. Also tried with skeleton Sveltekit project, got the same output.

svelte.config.js

// import adapter from '@sveltejs/adapter-auto';
import vercel from '@sveltejs/adapter-vercel';
/** @type {import('@sveltejs/kit').Config} */
const config = {
	kit: {
		adapter: vercel(),

		// Override http methods in the Todo forms
		methodOverride: {
			allowed: ['PATCH', 'DELETE']
		}
	}
};

export default config;

app.js file doesn’t appear in the output folder.

Screenshot from 2022-02-23 00-56-52

Reproduction

https://github.com/vlntsolo/adapter-vercel-issue

Logs

Run npm run preview to preview your production build locally.

> Using @sveltejs/adapter-vercel
 > .svelte-kit/vercel-tmp/entry.js:3:20: error: Could not resolve "../output/server/app.js"
    3 │ import { App } from '../output/server/app.js';
      ╵                     ~~~~~~~~~~~~~~~~~~~~~~~~~

> Build failed with 1 error:
.svelte-kit/vercel-tmp/entry.js:3:20: error: Could not resolve "../output/server/app.js"
.svelte-kit/vercel-tmp/entry.js:3:20: error: Could not resolve "../output/server/app.js"
    at failureErrorWithLog (/home/valentine/dev/nous-test/node_modules/esbuild/lib/main.js:1493:15)
    at /home/valentine/dev/nous-test/node_modules/esbuild/lib/main.js:1151:28
    at runOnEndCallbacks (/home/valentine/dev/nous-test/node_modules/esbuild/lib/main.js:1069:65)
    at buildResponseToResult (/home/valentine/dev/nous-test/node_modules/esbuild/lib/main.js:1149:7)
    at /home/valentine/dev/nous-test/node_modules/esbuild/lib/main.js:1258:14
    at /home/valentine/dev/nous-test/node_modules/esbuild/lib/main.js:629:9
    at handleIncomingPacket (/home/valentine/dev/nous-test/node_modules/esbuild/lib/main.js:726:9)
    at Socket.readFromStdout (/home/valentine/dev/nous-test/node_modules/esbuild/lib/main.js:596:7)
    at Socket.emit (events.js:400:28)
    at addChunk (internal/streams/readable.js:293:12)

System Info

ubuntu 21.10
node v14.19.0

Severity

blocking an upgrade

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Rich-Harriscommented, Feb 23, 2022

this should be fixed now, if you npm i -D @sveltejs/adapter-auto@next

2reactions
nrabulinskicommented, Feb 22, 2022

I am also encountering this issue on the latest sveltekit version. My temporary fix is to pin package versions in package.json

"@sveltejs/adapter-auto": "=1.0.0-next.17",
"@sveltejs/adapter-vercel": "=1.0.0-next.43",
"@sveltejs/kit": "=1.0.0-next.278",

like so, as those are the latest versions which I can see worked for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot build with .node files and Vercel adapter #1547 - GitHub
Building works with adapter-node , and I'd assume Vercel supports .node files since Next.js uses the same sharp library.
Read more >
Deploy SvelteKit App to Vercel, could not resolve install-fetch
It seems I was using an old adapter. npm install @sveltejs/adapter-auto@1.0.0-next.83 fixed it.
Read more >
How do I resolve a 'module not found' error? - Vercel
This would mean that your repository is now syntactically incorrect, resulting in a build error when deploying the repository on the Vercel platform....
Read more >
@sveltejs/adapter-static - npm
Adapter for SvelteKit apps that prerenders your entire site as a collection of static files. If you'd like to prerender only some pages, ......
Read more >
Troubleshooting JSS Next.js apps - Sitecore Documentation
The most common cause of failed builds and apps that cannot render pages is an ... Error "XmlException: Root element is missing" in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found