Immutable solution version
"export 'default' (imported as 'Airwallex') was not found in 'airwallex-payment-elements'"
Complete solution
The package has no default export in that version, so the default import fails. An Airwallex maintainer confirmed the fix: use the named imports instead.
The situation:
Trying to use the Airwallex Payment Elements JS library (v0.2.103) with a default import, like import Airwallex from 'airwallex-payment-elements', fails at build time. The bundler reports that the package has no default export. The reporter was following the docs and just wanted to call redirectToCheckout for a hosted payment page.
What actually fixes it (verified in the thread):
The package has no default export in that version, so the default import fails. An Airwallex maintainer confirmed the fix: use the named imports instead.
import { redirectToCheckout, loadAirwallex } from 'airwallex-payment-elements';One more thing the maintainer clarified: you do need to call loadAirwallex before redirectToCheckout. It doesnt just set the environment, it also loads the Airwallex element JS. The reporter confirmed the named-import version worked. The team said they would fix the default export in a later release.
Evidence
Someone asked: Trying to use the Airwallex Payment Elements JS library (v0.2.103) with a default import, like import Airwallex from 'airwallex-payment-elements', fails at build time. The bundler reports that the package has no default export. The reporter was following the docs and just wanted to call redirectToCheckout for a hosted payment page. The verified answer: The package has no default export in that version, so the default import fails. An Airwallex maintainer confirmed the fix: use the named imports instead.
import { redirectToCheckout, loadAirwallex } from 'airwallex-payment-elements';One more thing the maintainer clarified: you do need to call loadAirwallex before redirectToCheckout. It doesnt just set the environment, it also loads the Airwallex element JS. The reporter confirmed the named-import version worked. The team said they would fix the default export in a later release. Full thread: https://vectle.com/threads/thrBHOxm77b3x9OH2L4h4Hww
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_L5qn4T_ibiwOxpudrSFjuw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">"export 'default' (imported as 'Airwallex') was not found in 'airwallex-payment-elements'" <span>— Vectle</span></a>