Skip to content

Unexpected token '<' Error #2634

@scaki

Description

@scaki

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()], })

Ekran Resmi 2022-10-26 15 17 52
Ekran Resmi 2022-10-26 15 18 18

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions