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 seems to be broken at @sveltejs/kit@1.0.0-next.292 #4224

Closed
brunobely opened this issue Mar 5, 2022 · 23 comments · Fixed by #4229
Closed

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

brunobely opened this issue Mar 5, 2022 · 23 comments · Fixed by #4229
Labels
bug Something isn't working

Comments

@brunobely
Copy link

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

@Conduitry
Copy link
Member

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

@Travja
Copy link

Travja commented Mar 5, 2022

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.

@evdama
Copy link

evdama commented Mar 5, 2022

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$

@faisalramdan17
Copy link

faisalramdan17 commented Mar 5, 2022

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

@Sunyuzu
Copy link

Sunyuzu commented Mar 5, 2022

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

@HalCodes
Copy link

HalCodes commented Mar 5, 2022

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

@nstuyvesant
Copy link
Contributor

See this issue is closed but I'm still experiencing the problem with adapter-node. Just reverted to SvelteKit 1.0.0-next.291 as a temporary fix.

@frederikhors
Copy link
Contributor

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

@K-Sato1995
Copy link
Contributor

K-Sato1995 commented Mar 6, 2022

The solution from me turns back or use the previous version that 1.0.0-next.288.
@sveltejs/kit@1.0.0-next.291

so any version that doesn't include the changes made by #4192 currently works?

@baseballyama
Copy link
Member

so any version that doesn't include the changes made by #4192 currently works?

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

nachtjasmin added a commit to nachtjasmin/corona-noergel-app that referenced this issue Mar 9, 2022
dependabot bot pushed a commit to nachtjasmin/corona-noergel-app that referenced this issue Mar 9, 2022
@phiberber
Copy link

so any version that doesn't include the changes made by #4192 currently works?

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

I'm still having the same issue even with adapter-static 1.0.0-next.29.

@amarhasic
Copy link

Same here, issue persists even with rolling back the adapter version.

@benmccann
Copy link
Member

It would be much more useful to open a new issue rather than comment on a closed issue. The comments here have none of the information that would be required to debug an issue and the issue template will guide you to providing that information

@saturnonearth
Copy link

Same here, issue persists even with rolling back the adapter version.

I managed to fix mine by manually installing/updating both sveltekit and the adapter even though they were set to install the latest version when building in Netlify.

@benmccann
Copy link
Member

You probably needed to update your npm lock file

incontrolapps added a commit to ONSvisual/scrolly_AML_robo_animation_svelteKit that referenced this issue Mar 28, 2022
@johnkegd
Copy link

johnkegd commented Apr 2, 2022

Thanks dude. @faisalramdan17

@mhenrichsen
Copy link

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",

@nmsobri
Copy link

nmsobri commented Apr 25, 2022

why is this closed? has it being fixed?

@baseballyama
Copy link
Member

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.

@justingolden21
Copy link

justingolden21 commented May 6, 2022

Has this issue been fixed? What version of the netlify adapter is necessary to fix?

Had no idea why my code was failing until this thread, and I didn't even update or install or remove any packages...

EDIT: ran npm update and now on build I get builder.writePrerendered is not a function

image

@lukas-h
Copy link

lukas-h commented May 6, 2022

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

@qudo-code
Copy link

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

Yeah, for me I only got around it with some magical combination of downgraded versions. Eventually something worked, not ideal by any means. 🤷

@tallestlegacy
Copy link

I did a pnpm update and it just worked
good things do happen when you update after all

justuswilhelm added a commit to jwpconsulting/projectify-frontend that referenced this issue Aug 4, 2022
Also, update adapter-static to 1.0.0-next.29, following the instructions
from
sveltejs/kit#4224 (comment)
and setting kit.prerender.default to true (whatever that means...)
justuswilhelm added a commit to jwpconsulting/projectify-frontend that referenced this issue Aug 5, 2022
Also, update adapter-static to 1.0.0-next.29, following the instructions
from
sveltejs/kit#4224 (comment)
and setting kit.prerender.default to true (whatever that means...)
justuswilhelm added a commit to jwpconsulting/projectify-frontend that referenced this issue Mar 14, 2023
Also, update adapter-static to 1.0.0-next.29, following the instructions
from
sveltejs/kit#4224 (comment)
and setting kit.prerender.default to true (whatever that means...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.