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

Vite and vercel-adapter depend on incompatible versions of Esbuild #12047

Closed
mquandalle opened this issue Mar 28, 2024 · 5 comments
Closed

Vite and vercel-adapter depend on incompatible versions of Esbuild #12047

mquandalle opened this issue Mar 28, 2024 · 5 comments

Comments

@mquandalle
Copy link

Describe the bug

When updating my packages to their latest version and deploying on Vercel I get the following error:

Error: Expected "0.20.2" but got "0.19.12"
    at validateBinaryVersion (/vercel/path0/node_modules/vite/node_modules/esbuild/install.js:133:11)
    at /vercel/path0/node_modules/vite/node_modules/esbuild/install.js:286:5
Node.js v20.11.1
error: postinstall script from "esbuild" exited with 1
Error: Command "bun install" exited with 1

I believe this is because @sveltejs/adapter-vercel depends on Esbuild ^0.19 while vite depends on its version ^0.20, which is semver incompatible:

"esbuild": "^0.19.11"

https://github.com/vitejs/vite/blob/1f5379601e80d63916b7d77dd16d5dd8387e0002/packages/vite/package.json#L88

I think this could be fixed by accepting esbuild@^0.20 as a adapter-vercel dependency (supporting both 0.19 and 0.20)

Reproduction

N/A

Logs

No response

System Info

System:
    OS: macOS 14.3.1
    CPU: (8) arm64 Apple M2
    Memory: 91.36 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.16.0/bin/yarn
    npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm
    pnpm: 8.14.1 - ~/.nvm/versions/node/v18.16.0/bin/pnpm
    bun: 1.0.33 - ~/.bun/bin/bun
  Browsers:
    Brave Browser: 114.1.52.126
    Safari: 17.3.1
  npmPackages:
    @sveltejs/adapter-vercel: ^5.1.0 => 5.2.0 
    @sveltejs/enhanced-img: ^0.1.8 => 0.1.9 
    @sveltejs/kit: ^2.5.0 => 2.5.4 
    @sveltejs/pancake: ^0.0.18 => 0.0.18 
    @sveltejs/vite-plugin-svelte: ^3.0.2 => 3.0.2 
    svelte: ^4.2.10 => 4.2.12 
    vite: ^5.1.0 => 5.2.6

Severity

blocking an upgrade

Additional Information

No response

@mquandalle mquandalle changed the title Vite and vercel-adapter depends on incompatible versions of Esbuild Vite and vercel-adapter depend on incompatible versions of Esbuild Mar 28, 2024
@Jarred-Sumner
Copy link

Jarred-Sumner commented Mar 29, 2024

I suspect this is a bug in Bun and not in SvelteKit. Can you try running bun install --force locally and then commit the updated lockfile (and upgrade to Bun v1.0.36)? cc @dylan-conway

@mquandalle
Copy link
Author

Hi Jarred, thanks for shimming in! Unfortunately, upgrading Bun to v1.0.36, and bun install --force (also tried bun update --force and rm bun.lockd && bun install) doesn't fix the issue.
There are always 2 versions of esbuild in my bun.lockd, but I think this is expected because vite asks for esbuild@0.20 and vercel-adapter for esbuild@0.19. So maybe the actual issue is during bun install on Vercel which use an older version of bun?

@novelnet
Copy link

Having exact same issue

@benmccann
Copy link
Member

I'll close this since it seems to be a bug in bun. I do plan to upgrade Vite and esbuild in SvelteKit, but have been waiting for vitest to upgrade first: vitest-dev/vitest#5421

@mquandalle
Copy link
Author

mquandalle commented Apr 8, 2024

oven-sh/bun#9544

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants