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

The esbuild-transpile error occurred when vite5.0+ build #16683

Closed
7 tasks done
CoutinhoTTS opened this issue May 15, 2024 · 1 comment
Closed
7 tasks done

The esbuild-transpile error occurred when vite5.0+ build #16683

CoutinhoTTS opened this issue May 15, 2024 · 1 comment

Comments

@CoutinhoTTS
Copy link

Describe the bug

image image

The build failed on my computer, but the build was successful on stackblitz

Reproduction

https://stackblitz.com/edit/vitejs-vite-nmklt4?file=src%2Findex.js

Steps to reproduce

pnpm build

System Info

System:
    OS: macOS 12.6.6
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Memory: 62.85 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.19.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - ~/Library/pnpm/pnpm
    bun: 1.1.4 - /usr/local/bin/bun
  Browsers:
    Chrome: 124.0.6367.203
    Edge: 124.0.2478.105
    Safari: 17.0
  npmPackages:
    vite: ^5.2.11 => 5.2.11

Used Package Manager

pnpm

Logs

Click to expand!
> [email protected] build /Users/mac/project/webpack_to_vite/vite-test
> vite build

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
vite v5.2.11 building for production...
✓ 1 modules transformed.
x Build failed in 70ms
error during build:
Error: [vite:esbuild-transpile] Transform failed with 1 error:
vite-test.mjs:1:8: ERROR: Expected ";" but found "func"

Expected ";" but found "func"
1  |  const t func = ()=>{
   |          ^
2  |    console.log('this is a function');;
3  |  };;

    at failureErrorWithLog (/Users/mac/project/webpack_to_vite/vite-test/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1651:15)
    at /Users/mac/project/webpack_to_vite/vite-test/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:849:29
    at responseCallbacks.<computed> (/Users/mac/project/webpack_to_vite/vite-test/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:704:9)
    at handleIncomingPacket (/Users/mac/project/webpack_to_vite/vite-test/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:764:9)
    at Socket.readFromStdout (/Users/mac/project/webpack_to_vite/vite-test/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:680:7)
    at Socket.emit (node:events:517:28)
    at addChunk (node:internal/streams/readable:368:12)
    at readableAddChunk (node:internal/streams/readable:341:9)
    at Readable.push (node:internal/streams/readable:278:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
 ELIFECYCLE  Command failed with exit code 1.

Validations

Copy link

stackblitz bot commented May 15, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@github-actions github-actions bot locked and limited conversation to collaborators May 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant