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 build fails on 1.2.1 #16823

Closed
LetrixZ opened this issue Jan 28, 2025 · 28 comments · Fixed by #16856
Closed

Vite build fails on 1.2.1 #16823

LetrixZ opened this issue Jan 28, 2025 · 28 comments · Fixed by #16856
Assignees
Labels
bug Something isn't working confirmed bug We can reproduce this issue regression

Comments

@LetrixZ
Copy link

LetrixZ commented Jan 28, 2025

Edit: fixed in #16856, this will be part of Bun v1.2.2

original issue:


What version of Bun is running?

1.2.1+ce532901c

What platform is your computer?

Darwin 24.2.0 arm64 arm

What steps can reproduce the bug?

Here's a trimmed down project that has the issue: https://github.com/LetrixZ/bun-issue

  • Clone
  • Install dependencies: bun install
  • Run build command: bun run build

What is the expected behavior?

Build succeeding like on 1.2.0 and previous versions

What do you see instead?

Build fails with different issues. Examples:

error during build:
[vite-plugin-sveltekit-compile] [vite:esbuild-transpile] Transform failed with 1 error:
_app/immutable/chunks/user.!~{00b}~.js:14308:110: ERROR: Expected ")" but found "\x14"

Expected ")" but found "\x14"
14306|  		if ('transitionConfig' in $$new_props) $$invalidate(2, transitionConfig = $$new_props.transitionConfig);
14307|  		if ('inTransition' in $$new_props) $$invalidate(3, inTransition = $$new_props.inTransition);
14308|  		if ('inTransitionConfig' in $$new_props) $$invalidate(4, inTransitionConfig = $$new_props.inTransitionConfig);
   |                                                                                                                ^
14309|  		if ('outTransition' in $$new_props) $$invalidate(5, outTransition = $$new_props.outTransition);
14310|  		if ('outTransitionConfig' in $$new_props) $$invalidate(6, outTransitionConfig = $$new_props.outTransitionConfig);


Expected ")" but found "\x14"
14306|  		if ('transitionConfig' in $$new_props) $$invalidate(2, transitionConfig = $$new_props.transitionConfig);
14307|  		if ('inTransition' in $$new_props) $$invalidate(3, inTransition = $$new_props.inTransition);
14308|  		if ('inTransitionConfig' in $$new_props) $$invalidate(4, inTransitionConfig = $$new_props.inTransitionConfig);
   |                                                                                                                ^
14309|  		if ('outTransition' in $$new_props) $$invalidate(5, outTransition = $$new_props.outTransition);
14310|  		if ('outTransitionConfig' in $$new_props) $$invalidate(6, outTransitionConfig = $$new_props.outTransitionConfig);

[vite:esbuild-transpile] Transform failed with 1 error:
_app/immutable/chunks/user.!~{00b}~.js:14308:110: ERROR: Expected ")" but found "\x14"

Expected ")" but found "\x14"
14306|  		if ('transitionConfig' in $$new_props) $$invalidate(2, transitionConfig = $$new_props.transitionConfig);
14307|  		if ('inTransition' in $$new_props) $$invalidate(3, inTransition = $$new_props.inTransition);
14308|  		if ('inTransitionConfig' in $$new_props) $$invalidate(4, inTransitionConfig = $$new_props.inTransitionConfig);
   |                                                                                                                ^
14309|  		if ('outTransition' in $$new_props) $$invalidate(5, outTransition = $$new_props.outTransition);
14310|  		if ('outTransitionConfig' in $$new_props) $$invalidate(6, outTransitionConfig = $$new_props.outTransitionConfig);

    at failureErrorWithLog (/Users/fermin/Downloads/bun-issue-main/node_modules/esbuild/lib/main.js:1472:19)
    at <anonymous> (/Users/fermin/Downloads/bun-issue-main/node_modules/esbuild/lib/main.js:755:50)
    at <anonymous> (/Users/fermin/Downloads/bun-issue-main/node_modules/esbuild/lib/main.js:622:9)
    at handleIncomingPacket (/Users/fermin/Downloads/bun-issue-main/node_modules/esbuild/lib/main.js:677:12)
    at readFromStdout (/Users/fermin/Downloads/bun-issue-main/node_modules/esbuild/lib/main.js:600:7)
    at emit (node:events:87:22)
    at addChunk (internal:streams/readable:265:47)
    at readableAddChunkPushByteMode (internal:streams/readable:243:18)
    at handleNumberResult (internal:streams/native-readable:69:18)
    at <anonymous> (internal:streams/native-readable:43:68)
error during build:
[vite-plugin-sveltekit-compile] [vite:esbuild-transpile] Transform failed with 1 error:
_app/immutable/chunks/user.!~{00b}~.js:17888:168: ERROR: Unterminated string literal

Unterminated string literal
17887|        default: "bg-primary text-primary-foreground hover:bg-primary/90",
17888|        "primary-outline": "border border-primary/50 bg-transparent text-foreground hover:bg-primary/20",
17889|        destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
   |                                                                  ^
17890|        indigo: "bg-indigo-700 text-foreground hover:bg-indigo-700/90",
17891|        "indigo-outline": "border border-indigo-700/50 bg-transparent text-foreground hover:bg-indigo-700/20",


Unterminated string literal
17887|        default: "bg-primary text-primary-foreground hover:bg-primary/90",
17888|        "primary-outline": "border border-primary/50 bg-transparent text-foreground hover:bg-primary/20",
17889|        destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
   |                                                                  ^
17890|        indigo: "bg-indigo-700 text-foreground hover:bg-indigo-700/90",
17891|        "indigo-outline": "border border-indigo-700/50 bg-transparent text-foreground hover:bg-indigo-700/20",

[vite:esbuild-transpile] Transform failed with 1 error:
_app/immutable/chunks/user.!~{00b}~.js:17888:168: ERROR: Unterminated string literal

Unterminated string literal
17887|        default: "bg-primary text-primary-foreground hover:bg-primary/90",
17888|        "primary-outline": "border border-primary/50 bg-transparent text-foreground hover:bg-primary/20",
17889|        destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
   |                                                                  ^
17890|        indigo: "bg-indigo-700 text-foreground hover:bg-indigo-700/90",
17891|        "indigo-outline": "border border-indigo-700/50 bg-transparent text-foreground hover:bg-indigo-700/20",

    at failureErrorWithLog (/Users/fermin/Downloads/bun-issue-main/node_modules/esbuild/lib/main.js:1472:19)
    at <anonymous> (/Users/fermin/Downloads/bun-issue-main/node_modules/esbuild/lib/main.js:755:50)
    at <anonymous> (/Users/fermin/Downloads/bun-issue-main/node_modules/esbuild/lib/main.js:622:9)
    at handleIncomingPacket (/Users/fermin/Downloads/bun-issue-main/node_modules/esbuild/lib/main.js:677:12)
    at readFromStdout (/Users/fermin/Downloads/bun-issue-main/node_modules/esbuild/lib/main.js:600:7)
    at emit (node:events:87:22)
    at addChunk (internal:streams/readable:265:47)
    at readableAddChunkPushByteMode (internal:streams/readable:243:18)
    at handleNumberResult (internal:streams/native-readable:69:18)
    at <anonymous> (internal:streams/native-readable:43:68)

Additional information

No response

@LetrixZ LetrixZ added bug Something isn't working needs triage labels Jan 28, 2025
@RiskyMH RiskyMH added confirmed bug We can reproduce this issue regression and removed needs triage labels Jan 28, 2025
@RiskyMH
Copy link
Member

RiskyMH commented Jan 28, 2025

Appears to have regressed with #16754

@R0guelands
Copy link

I don't know if its related, but the error i get is very similar on vite + react build:

Im trying to build vite + react using bun run build, and im getting this error after using the latest bun 1.2.1:

3.200 [vite:define] Transform failed with 1 error:
3.200 /app/node_modules/react-router/dist/development/chunk-SYFQ2XB5.mjs:6679:25: ERROR: Unexpected "\xce"
3.200 file: /app/node_modules/react-router/dist/development/chunk-SYFQ2XB5.mjs
3.200     at failureErrorWithLog (/app/node_modules/esbuild/lib/main.js:1476:19)
3.200     at <anonymous> (/app/node_modules/esbuild/lib/main.js:755:50)
3.200     at <anonymous> (/app/node_modules/esbuild/lib/main.js:622:9)
3.200     at handleIncomingPacket (/app/node_modules/esbuild/lib/main.js:677:12)
3.200     at readFromStdout (/app/node_modules/esbuild/lib/main.js:600:7)
3.200     at emit (node:events:87:22)
3.200     at addChunk (internal:streams/readable:265:47)
3.200     at readableAddChunkPushByteMode (internal:streams/readable:243:18)
3.200     at handleNumberResult (internal:streams/native-readable:69:18)
3.200     at <anonymous> (internal:streams/native-readable:43:68)
3.239 error: script "build" exited with code 1

it worked fine before updating.

@jean-dusenne
Copy link

jean-dusenne commented Jan 28, 2025

Hello
same issue for me with 1.2.1 version
Project based on nuxt framework

#15 18.24  ERROR  Nuxt Build Error: [commonjs--resolver] Transform failed with 1 error:
#15 18.24 /usr/src/app/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:6983:10: ERROR: Unexpected "\a"
#15 18.24 file: /usr/src/app/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js

set docker image to oven/bun:1.2.0-alpine instead of oven/bun:1-alpine in order to build project

@binajmen
Copy link

binajmen commented Jan 28, 2025

I can confirm I have the same issue with 1.2.1 using SolidStart. Switching back to 1.2.0 solved the issue.

@R0guelands
Copy link

Downgraded the docker image to oven/bun:1.2.0-slim and the build pipeline worked again for vite + react.

@TiBianMod
Copy link

same here, with VUE

vite v6.0.11 building for production...
✓ 6749 modules transformed.
x Build failed in 10.55s
[ error ] [vite:esbuild-transpile] Transform failed with 1 error:
assets/highlighter-!~{00e}~.js:9438:25: ERROR: Expected ")" but found "\x81"

Expected ")" but found "\x81"
9436|    const colorPalette = createColorPalette(
9437|      Object.fromEntries(
9438|        namedColors.map((name) => [
   |                           ^
9439|          name,
9440|          theme.colors?.[`terminal.ansi${name[0].toUpperCase()}${name.substring(1)}`]

rendering chunks (11)...%       

@nikolap
Copy link

nikolap commented Jan 28, 2025

Same issue with bun + vite on Ubuntu 2024 and macOS 15.

Can confirm rollback to 1.2.0 fixes it on all platforms

@cjkoepke
Copy link

Same on bun + vite, can confirm 1.2.0 works.

@jack-y
Copy link

jack-y commented Jan 28, 2025

Same on bun + sveltekit on Ubuntu 24.04, can confirm 1.2.0 works.

@tomredman
Copy link
Contributor

Yup, seeing this as well: vinxi + vite + bun 1.2.1

@basb7
Copy link

basb7 commented Jan 28, 2025

Tuve el mismo error usando vite + react.
¡Si uso la versión de bun 1.2.0 funciona perfecto!.

@xfathurrahman
Copy link

same on bun + vite + laravel 🐸

@joaolisboa
Copy link

joaolisboa commented Jan 28, 2025

Also seeing this on Vite + Nuxt/Vue. Works locally, but fails in my CI/CD with latest alpine

Switching to 1.2.0-apline fixed it

@R0guelands
Copy link

Very interesting to see. Bun 1.2.1 works locally with bun run build for vite + react, but fails in CI/CD pipeline using docker image.

@Jarred-Sumner
Copy link
Collaborator

We don’t have a fix yet, but we are working on it and will do a release once it’s fixed

@itorz7
Copy link

itorz7 commented Jan 29, 2025

with vite (remix) too
and prisma cannot generate it stuck
but 1.2.0 working

@anime-shed
Copy link

facing the same on my nuxt project, while Bun 1.2.1 works locally with bun run build for nuxt, but fails in CI/CD pipeline using docker image:

ℹ ✓ 2012 modules transformed.

 ERROR  x Build failed in 34.90s


[nuxi]  ERROR  Nuxt Build Error: [commonjs--resolver] Transform failed with 1 error:
/app/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:6995:25: ERROR: Expected identifier but found "\xc5"
file: /app/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js

    node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:6995:25: ERROR: Expected identifier but found "\xc5"
    file: node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
    at failureErrorWithLog (node_modules/esbuild/lib/main.js:1476:19)
    at <anonymous> (node_modules/esbuild/lib/main.js:755:50)
    at <anonymous> (node_modules/esbuild/lib/main.js:622:9)
    at handleIncomingPacket (node_modules/esbuild/lib/main.js:677:12)
    at readFromStdout (node_modules/esbuild/lib/main.js:600:7)
    at emit (node:events:87:22)
    at addChunk (internal:streams/readable:265:47)
    at readableAddChunkPushByteMode (internal:streams/readable:243:18)
    at handleArrayBufferViewResult (internal:streams/native-readable:79:16)
    at <anonymous> (internal:streams/native-readable:43:68)
    at processTicksAndRejections (native:7:39)

error: script "build:beta" exited with code 1
error: process "/bin/sh -c bun run build:${buildEnv}" did not complete successfully: exit code: 1

had to switch to oven/bun:1.1.45-alpine for temp fix.

@cmjoseph07
Copy link

Same error with macos + sveltekit, bun 1.2.1 is broken but 1.2.0 is fine for both docker image and locally.

@chtibizoux
Copy link

I have no crash but an infinite build that blocks on rendering chunks (94)... only with bun 1.2.1.
I'm using sveltekit 2.16.1 and vite 6.0.11.
It seems to be an error with vite I suggest to change the title.

@Jarred-Sumner Jarred-Sumner changed the title SvelteKit build fails on 1.2.1 Vite build fails on 1.2.1 Jan 29, 2025
@RiskyMH RiskyMH marked this as a duplicate of #16868 Jan 29, 2025
@Karakatiza666
Copy link

We had a similar error with Vite + SvelteKit on arm64 machine

@zx8086
Copy link

zx8086 commented Jan 30, 2025

Yay... same issue, I am in the mix ! Bun 1.2.1 + Svelte 5.18.0 + Vite 6.0.7

5.741 vite v6.0.11 building for production...
5.747 transforming...
9.523  1398 modules transformed.
9.902 rendering chunks...
9.937 x Build failed in 4.20s
9.955 x Build failed in 7.89s
9.956 error during build:
9.956 [vite-plugin-sveltekit-compile] [vite:esbuild-transpile] Transform failed with 1 error:
9.956 _app/immutable/chunks/!~{00f}~.js:2645:27: ERROR: Expected ")" but found "\x00"
9.956 
9.956 Expected ")" but found "\x00"
9.956 2643|      const decoder = new TextDecoder();
9.956 2644|      function deserialize(data) {
9.956 2645|        return unflatten(data, {
9.956    |                             ^
9.956 2646|          ...app.decoders,
9.956 2647|          Promise: (id) => {
9.956 
9.956 
9.956 Expected ")" but found "\x00"
9.956 2643|      const decoder = new TextDecoder();
9.956 2644|      function deserialize(data) {
9.956 2645|        return unflatten(data, {
9.956    |                             ^
9.956 2646|          ...app.decoders,
9.956 2647|          Promise: (id) => {
9.956 
9.956 [vite:esbuild-transpile] Transform failed with 1 error:
9.956 _app/immutable/chunks/!~{00f}~.js:2645:27: ERROR: Expected ")" but found "\x00"
9.956 
9.956 Expected ")" but found "\x00"
9.956 2643|      const decoder = new TextDecoder();
9.956 2644|      function deserialize(data) {
9.956 2645|        return unflatten(data, {
9.956    |                             ^
9.956 2646|          ...app.decoders,
9.956 2647|          Promise: (id) => {
9.956 
9.956     at failureErrorWithLog (/app/node_modules/esbuild/lib/main.js:1476:19)
9.956     at <anonymous> (/app/node_modules/esbuild/lib/main.js:755:50)
9.956     at <anonymous> (/app/node_modules/esbuild/lib/main.js:622:9)
9.956     at handleIncomingPacket (/app/node_modules/esbuild/lib/main.js:677:12)
9.956     at readFromStdout (/app/node_modules/esbuild/lib/main.js:600:7)
9.956     at emit (node:events:87:22)
9.956     at addChunk (internal:streams/readable:265:47)
9.956     at readableAddChunkPushByteMode (internal:streams/readable:243:18)
9.956     at handleArrayBufferViewResult (internal:streams/native-readable:79:16)
9.956     at <anonymous> (internal:streams/native-readable:43:68)
10.02 error: "vite" exited with code 1

@Jarred-Sumner
Copy link
Collaborator

We are still working on a fix. Aiming to release tonight with the fix (and some memory reductions)

@moshOntong-IT
Copy link

I encountered this as well on vite react pwc with tanstack router. But it fix when using FROM oven/bun:1.2.0-alpine

@nicksrandall
Copy link

Also seeing this issue: Reverting back to 1.2.0 fixes it for me.

@brielov
Copy link

brielov commented Jan 31, 2025

Landed here because I was trying to build a react-router 7 app (vite) with just bun (no node) and it hangs on transforming... when I do bun run build. I tried this locally and with a Dockerfile and same thing. Bun version is 1.2.1.

@nicksrandall
Copy link

nicksrandall commented Jan 31, 2025

@Jarred-Sumner are we still thinking that a fix for this will land in 1.2.2?

@LetrixZ
Copy link
Author

LetrixZ commented Jan 31, 2025

Using 1.2.1-canary.37+d4ce42198 can confirm that my project builds fine now. Thanks!

@zx8086
Copy link

zx8086 commented Feb 1, 2025

Thanks @Jarred-Sumner & team, fixed !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed bug We can reproduce this issue regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.