If someone is still facing this, add to the esbuild config:
exclude: - 'jsdom' - 'canvas' external: - 'jsdom' - 'canvas'
It needs to be both to work! Workaround discussed here:
https://github.com/evanw/esbuild/issues/1311