We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
onEnd()
Hi,
Thank you for your hard work in making this amazing bundler perfectly and efficiently.
Could you please look into why the onEnd() callback isn't handling errors properly? It only returns text, while everything else is omitted.
text
The same works as expected in onStart, onResolve and onLoad callbacks.
import * as esbuild from 'esbuild-wasm' class CustomError extends Error { detail: any location: any id: string constructor(message: string) { super(message) this.name = 'CustomError' this.detail = { code: 'CUSTOM_CODE', } this.location = null this.id = '123' } } ;(async () => { await esbuild.initialize({ wasmURL: './node_modules/esbuild-wasm/esbuild.wasm', }) try { await esbuild.build({ stdin: { contents: 'console.log(123)', sourcefile: '/index.js', resolveDir: '/', }, plugins: [ { name: 'test', setup(build) { build.onEnd(() => { throw new CustomError('hello') // Return {errors: [...]} // it will not work as well }) }, }, ], }) } catch (err) { console.log(JSON.stringify(err.errors, null, 2)) // Prints /** [ { "id": "", "pluginName": "test", "text": "hello", "location": null, "notes": [], "detail": 0 } ] */ } })()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
Thank you for your hard work in making this amazing bundler perfectly and efficiently.
Could you please look into why the
onEnd()
callback isn't handling errors properly? It only returnstext
, while everything else is omitted.The same works as expected in onStart, onResolve and onLoad callbacks.
The text was updated successfully, but these errors were encountered: