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

Esbuild 0.24.1 cause astro build to fail #12797

Closed
1 task
leochiu-a opened this issue Dec 20, 2024 · 5 comments
Closed
1 task

Esbuild 0.24.1 cause astro build to fail #12797

leochiu-a opened this issue Dec 20, 2024 · 5 comments
Labels
ecosystem: external External library doesn't work needs triage Issue needs to be triaged

Comments

@leochiu-a
Copy link

leochiu-a commented Dec 20, 2024

Astro Info

Astro                    v5.0.9
Node                     v23.3.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

The latest version of esbuild@0.24.1 causes astro build to fail. After changing the esbuild version to 0.24.0, everything works fine.

Expected identifier but found "import"
  Location:
    (define name):1:0
  Stack trace:
    at failureErrorWithLog (/solar-singularity/node_modules/.pnpm/esbuild@0.24.1/node_modules/esbuild/lib/main.js:1476:15)
    at responseCallbacks.<computed> (/solar-singularity/node_modules/.pnpm/esbuild@0.24.1/node_modules/esbuild/lib/main.js:622:9)
    at Socket.readFromStdout (/solar-singularity/node_modules/.pnpm/esbuild@0.24.1/node_modules/esbuild/lib/main.js:600:7)
    at addChunk (node:internal/streams/readable:559:12)
    at Readable.push (node:internal/streams/readable:390:5)
 ELIFECYCLE  Command failed with exit code 1.

What's the expected result?

astro build successfully.

Link to Minimal Reproducible Example

https://github.com/leochiu-a/astro-practice

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Dec 20, 2024
@leochiu-a leochiu-a changed the title Esbuild 0.24.1 cause astro build failed Esbuild 0.24.1 cause astro build to fail Dec 20, 2024
@utkarshkukreti
Copy link

evanw/esbuild#4010

@SerkanSipahi
Copy link

@leochiu-a I can confirm this error. I have the same error message.

@ematipico ematipico added the ecosystem: external External library doesn't work label Dec 20, 2024
@rlarreasanchez
Copy link

rlarreasanchez commented Dec 20, 2024

I have the same error in a blank Astro 5.1 project, with no added dependencies, just creating the basic project and then running the build. As a workaround, force esbuild to version 0.24.0 worked for me.
npm i -D esbuild@0.24.0

@ematipico
Copy link
Member

Going to close the issue since this isn't an Astro issue. You can follow the upstream issue.

@ematipico ematipico closed this as not planned Won't fix, can't repro, duplicate, stale Dec 20, 2024
@prth
Copy link

prth commented Dec 20, 2024

Facing same issue ^

On astro project level, can address the problem temporarily by overriding the version.

I couldn't override version of esbuild using npm (10.9.0)
I had to switch to using pnpm (9.15.1) package manager to override the esbuild dependency version to 0.24.0

"pnpm": {
    "overrides": {
      "esbuild": "0.24.0"
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ecosystem: external External library doesn't work needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

6 participants