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

[Bug]: esbuild fails with ERROR: Invalid option in build() call: "jsxImportSource" #20215

Closed
tmeasday opened this issue Dec 13, 2022 · 3 comments
Assignees

Comments

@tmeasday
Copy link
Member

tmeasday commented Dec 13, 2022

Describe the bug

We use jsxImportSource as an option to esbuild:

jsxImportSource: 'react',

However the feature was introduced in 0.14.51: evanw/esbuild#2349

And we only depend on

"esbuild": "^0.14.48",

To Reproduce

Not 100% clear, somehow it happened in that in this project that has no other clear dependency on `esbuild` I ended up with `0.14.49`. The error is:


✘ [ERROR] Invalid option in build() call: "jsxImportSource"

    /Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:241:12:
      241 │       throw new Error(`Invalid option ${where}: "${key}"`);
          ╵             ^

    at checkForInvalidFlags (/Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:241:13)
    at flagsForBuildOptions (/Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:424:3)
    at buildOrServeContinue (/Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:1213:9)
    at /Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:1142:13

ERR! Error: Build failed with 1 error:
ERR! /Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:241:12: ERROR: Invalid option in build() call: "jsxImportSource"
ERR!     at failureErrorWithLog (/Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:1605:15)
ERR!     at /Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:1131:18
ERR!     at /Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:1126:9
ERR!     at /Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:666:9
ERR!     at handleIncomingPacket (/Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:763:9)
ERR!     at Socket.readFromStdout (/Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:632:7)
ERR!     at Socket.emit (node:events:390:28)
ERR!     at addChunk (node:internal/streams/readable:315:12)
ERR!     at readableAddChunk (node:internal/streams/readable:289:9)
ERR!     at Socket.Readable.push (node:internal/streams/readable:228:10)
ERR!  Error: Build failed with 1 error:
ERR! /Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:241:12: ERROR: Invalid option in build() call: "jsxImportSource"
ERR!     at failureErrorWithLog (/Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:1605:15)
ERR!     at /Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:1131:18
ERR!     at /Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:1126:9
ERR!     at /Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:666:9
ERR!     at handleIncomingPacket (/Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:763:9)
ERR!     at Socket.readFromStdout (/Users/tom/GitHub/inkline/inkline/node_modules/esbuild/lib/main.js:632:7)
ERR!     at Socket.emit (node:events:390:28)
@tmeasday
Copy link
Member Author

Note that it was easily fixed in this project via npm upgrade esbuild, which took it to 0.14.54

@ndelangen
Copy link
Member

ndelangen commented Dec 13, 2022

likely fixed by: #20199

@tmeasday
Copy link
Member Author

Ok, will close, thanks @ndelangen

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

No branches or pull requests

2 participants