Closed jmandel closed 2 years ago
This isn't a problem with the code here, but in some bundler contexts (I'm seeing this with parcel), generated output looks like:
... i.e., req may wind up undefined because the bundler helpfully determined at build time that resolve exists, even though at runtime it doesn't.
req
resolve
A try/catch is a bit of an ad-hoc fix but it's doing the trick in this instance.
Thanks. Webpack (via create-react-app) & rollup were fine with this. I did not check parcel. Thanks!
This isn't a problem with the code here, but in some bundler contexts (I'm seeing this with parcel), generated output looks like:
... i.e.,
req
may wind up undefined because the bundler helpfully determined at build time thatresolve
exists, even though at runtime it doesn't.A try/catch is a bit of an ad-hoc fix but it's doing the trick in this instance.