-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Unexpected token '<' Error #2634
Comments
I'm guessing you have |
We're also running into this, except we're getting the error during webpack compilation:
We currently run esbuild 0.14.38 and we're trying to upgrade to the latest esbuild. We have @evanw What's the correct way forward here? I tried reading the changelog from 0.14.51 but it's not clear how to proceed. Do we use the new JSX transform in esbuild? Do we change our tsconfig? A combination of both? |
Right now you would have to change your |
Okay yes, I reached the same conclusion on my own too. We have a monorepo of packages and I realized that most component packages are actually using Long story short, I switched to |
I can set the tsconfig.json setting to 'react-jsx' to be able to compile nested components (using mdx-bundler for context) but I'm in a nextjs app and on startup/build nextjs changes the setting back to 'preserve'. Any suggestions on how this might works together with esbuild with current workings. And additionally I was wondering if this proposed tsconfig changes fix this issue for the future (if a solution is currently not available with the workings of next changing the setting). Be grateful for any hint into which direction a solution is possible :-). |
What do you recommend to do when using esbuild with next? next overwrites tsconfig to ensure jsx value is preserve |
An upcoming version of esbuild may help you work around this (which is the commit that closed this issue). But you could also consider filling a bug with whatever tool you’re using that’s overwriting your config files. That sounds like a bug with that tool to me. |
Not a bug, Next, after vercel changed a lot its structure to match vercel's cloud, that means also changing your ts config. |
I have a preact project that I developed with typescript. I build with esbuild and add the output to an html page and I get the error in the image. What would be the reason?
My config:
esbuild .build({ entryPoints: ['./src/main.tsx'], bundle: true, minify: false, minifySyntax: true, sourcemap: false, write: true, jsx: 'transform', jsxFactory: 'h', outfile: 'dist/main.js', target: [ 'es2022', 'chrome58', 'edge16', 'firefox57', 'node12', 'safari11', ], platform: 'browser', globalName: 'lib', format: 'iife', supported: { destructuring: true }, loader: { '.svg': 'text' }, define: { PopupData: JSON.stringify(data), CampaignId: data.campaign.id }, plugins: [sassPlugin(), nodeExternalsPlugin()], })
The text was updated successfully, but these errors were encountered: