smart-on-fhir / smart-health-card-decoder

Sample code for a SMART Health Card validator
MIT License
3 stars 2 forks source link

Catch failed req() #6

Closed jmandel closed 2 years ago

jmandel commented 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: image

... 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.

A try/catch is a bit of an ad-hoc fix but it's doing the trick in this instance.

ljoy913 commented 2 years ago

Thanks. Webpack (via create-react-app) & rollup were fine with this. I did not check parcel. Thanks!