kit: adapter-vercel seems to be broken at @sveltejs/kit@1.0.0-next.292

Describe the bug

Vercel builds seem to be broken by #4192 since adapter-vercel still uses builder.prerender.

Reproduction

StackBlitz link

Run npm run build to see error.

Logs

At the end of build...

> Using @sveltejs/adapter-vercel
> builder.prerender() has been removed. Prerendering now takes place in the build phase — see builder.prerender and builder.writePrerendered
    at Object.prerender (file:///home/projects/sveltejs-kit-template-default-ansvrj/node_modules/@sveltejs/kit/dist/chunks/index4.js:183:10)
    at adapt (file:///home/projects/sveltejs-kit-template-default-ansvrj/node_modules/@sveltejs/adapter-vercel/index.js:116:38)
    at adapt (file:///home/projects/sveltejs-kit-template-default-ansvrj/node_modules/@sveltejs/kit/dist/chunks/index4.js:202:8)
    at eval (file:///home/projects/sveltejs-kit-template-default-ansvrj/node_modules/@sveltejs/kit/dist/cli.js:956:11)

System Info

Default node.new/sveltekit env. Left the command above running for ~5min and got no response.

Severity

blocking an upgrade

Additional Information

Blocks upgrade to @sveltejs/kit@1.0.0-next.292

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 19
  • Comments: 23 (7 by maintainers)

Commits related to this issue

Most upvoted comments

The solution from me turns back or use the previous version that 1.0.0-next.288 or 1.0.0-next.291 . you can try :

  1. Change "@sveltejs/kit": "next", to be "@sveltejs/kit": "1.0.0-next.291", at package.json.
  2. Remove "prepare": "svelte-kit sync" at package.json (if any there).
  3. Run npm install
  4. After that commit & push your repo
  5. Enjoy guys!

Thanks

Just going to note that this appears to impact more than just vercel. I’m attempting to build with the static-adapter and running into the same error message.

yes, same for adapter-node

Using @sveltejs/adapter-node
> builder.prerender() has been removed. Prerendering now takes place in the build phase — see builder.prerender and builder.writePrerendered
    at Object.prerender (file:///Users/sa/0/svk/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.292_svelte@3.46.4/node_modules/@sveltejs/kit/dist/chunks/index4.js:172:10)
    at adapt (file:///Users/sa/0/svk/node_modules/.pnpm/@sveltejs+adapter-node@1.0.0-next.70/node_modules/@sveltejs/adapter-node/index.js:39:18)
    at adapt (file:///Users/sa/0/svk/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.292_svelte@3.46.4/node_modules/@sveltejs/kit/dist/chunks/index4.js:191:8)
    at file:///Users/sa/0/svk/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.292_svelte@3.46.4/node_modules/@sveltejs/kit/dist/cli.js:936:11
 ELIFECYCLE  Command failed with exit code 1.
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module '/Users/sa/0/svk/build/index.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v17.6.0
m1-mini:svk sa$ svelte-kit --version
svelte-kit, 1.0.0-next.292
m1-mini:svk sa$

so any version that doesn’t include the changes made by https://github.com/sveltejs/kit/pull/4192 currently works?

Now we can install @sveltejs/adapter-static@1.0.0-next.29 and other latest adapters!

@sveltejs/kit@1.0.0-next.291 is also okay. Hope to fix Thank you @faisalramdan17 for information.

The build is broken. The release of adapter-static 29 is coming.

After much trial and error here are some settings that work:

"@sveltejs/adapter-netlify": "1.0.0-next.49",
"@sveltejs/kit": "1.0.0-next.291",

Sometimes destructive change occur because kit is under beta. And adapters may be updated at the same time accordingly. This means that the kit and adapters is only work with certain version combinations. So when you update kit version, I recommend that adapter version also should update as well.

This problem was opened when release timing between kit and adapters was off by several hours. And it was fixed few hours later and this issue is now closed.

If you have a problem now, you need to open a new issue.

It looks like #4192 didn’t include the appropriate changesets for any of the adapters, and so they weren’t actually released.

Confirmed that this issue also affects @sveltejs/adapter-netlify. Rolling back to @sveltejs/kit@1.0.0-next.291 is a working workaround.

Ran into the same problem yesterday with adapter-node and had to downgrade to 288.