smarty / smartystreets-javascript-sdk

The official client libraries for accessing SmartyStreets APIs from javascript.
https://smartystreets.com/docs/sdk/javascript
Apache License 2.0
31 stars 30 forks source link

Adds .default so create function could be found #78

Closed dave-smartystreets closed 10 months ago

dave-smartystreets commented 10 months ago

Adds .default to code to continue using Common JS

greg5green commented 7 months ago

Just in case anyone else comes here after seeing an error of Uncaught TypeError: Cannot read properties of undefined (reading 'create') coming from line 9 of HttpSender.js after upgrading their version of this SDK, you might need to update whatever bundler you're using in your project to handle the cjs file extension.

Axios switched their file extension somewhere between 0.26.1 and 1.62. We were handling js, mjs, ts, but not cjs. Once updating our webpack config to handle this, everything worked great!