NPM imports fail on JSON require
When importing modules via
npm:
protocol, the embedded esbuild will throw the following error if the module tries to require("package.json")
.
In my case, the problematic module is checkout-sdk-node
.
Is there known workaround for this?1 Reply
Turns out when a Fresh island shares the same file with NPM imports, it fails like that.
It makes total sense when the cause is known, esbuild shouldn't understands require("package.json") when targeting the web.
It would definitely saves me an hour or two with a better error message.