You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Module build failed (from ./node_modules/esbuild-loader/src/index.js):
Error: Transform failed with 1 error:
.../src/test.ts:1:44: error: Expected ">" but found ","
at failureErrorWithLog (.../node_modules/esbuild-loader/node_modules/esbuild/lib/main.js:303:15)
at .../node_modules/esbuild-loader/node_modules/esbuild/lib/main.js:258:29
at handleResponse (.../node_modules/esbuild-loader/node_modules/esbuild/lib/main.js:229:7)
at Socket.readFromStdout (.../node_modules/esbuild-loader/node_modules/esbuild/lib/main.js:159:7)
The text was updated successfully, but these errors were encountered:
This builds fine with esbuild when the file extension is .ts but fails with this error when the file extension is .tsx, so I'm assuming your file has a .tsx file extension:
example.tsx:1:44: error: Expected ">" but found ","
exportconstvalues=<V>(obj: Record<string,V>): V[]=>Object.keys(obj).map(k=>obj[k]);^
If you try building this with the official TypeScript compiler, that also gives a similar error:
So this doesn't look like a bug with esbuild to me. The behavior of esbuild matches the behavior of the official TypeScript compiler. Perhaps you are using the incorrect file extension? Or perhaps you're using esbuild's API and incorrectly passing tsx as the loader instead of ts?
Ah that makes sense!
I was actually using a ts file extension but had it wired up to options: { loader: 'tsx' } not considering the implications on parsing such constructs.
Thanks for the fast reply and sorry for the noise.
ESBuild fails to parse a rather complex arrow function in my project.
Minimal example:
The text was updated successfully, but these errors were encountered: