I am trying to use usps-webtools-promise through the NPM module functionality of Wix Velo. Unfortunately, the module does not load properly with the following console message. Any help appreciated.
Error: Error loading web module backend/verifyAddress.jsw: Must use import to load ES Module: /dynamic-modules/third-party-npm/3dc35ea1/WC_BEGIN/usps-webtools-promise/5.0.0/WC_END/usps-webtools-promise/dist/usps.js
require() of ES modules is not supported.
require() of /dynamic-modules/third-party-npm/3dc35ea1/WC_BEGIN/usps-webtools-promise/5.0.0/WC_END/usps-webtools-promise/dist/usps.js from backend/verifyAddress.jsw is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename usps.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /dynamic-modules/third-party-npm/3dc35ea1/WC_BEGIN/usps-webtools-promise/5.0.0/WC_END/usps-webtools-promise/package.json.
I am trying to use usps-webtools-promise through the NPM module functionality of Wix Velo. Unfortunately, the module does not load properly with the following console message. Any help appreciated.
Error: Error loading web module backend/verifyAddress.jsw: Must use import to load ES Module: /dynamic-modules/third-party-npm/3dc35ea1/WC_BEGIN/usps-webtools-promise/5.0.0/WC_END/usps-webtools-promise/dist/usps.js require() of ES modules is not supported. require() of /dynamic-modules/third-party-npm/3dc35ea1/WC_BEGIN/usps-webtools-promise/5.0.0/WC_END/usps-webtools-promise/dist/usps.js from backend/verifyAddress.jsw is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules. Instead rename usps.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /dynamic-modules/third-party-npm/3dc35ea1/WC_BEGIN/usps-webtools-promise/5.0.0/WC_END/usps-webtools-promise/package.json.