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


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