-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ✨ Add ESM module support #527
Comments
Hey @bjornharvold -- there should be an ESM variant of the Can you share what your element integration looks like? |
Apologies, should've added that during ticket creation. Updated ticket |
While it's an undocumented pattern, you should be able to import that
See my quick & dirty demo of this import running here: https://stackblitz.com/edit/stackblitz-starters-3nczh2 |
Thanks @brendanm-stripe Sneaky indeed 🍺 |
Stripe will need to either rename the output "dist" file to end with .mjs, or add "type":"module" to the package.json. Right now the ESM export is not ESM except in name. You can verify plainly using the nodejs CLI:
|
What happened?
Getting this when compiling with the latest Angular 17.x.
WARNING] Module '@stripe/stripe-js/pure' used by 'libs/stripe/ui-elements-issuing/src/lib/components/elements-issuing.component.ts' is not ESM
Here's our package.json import statement:
"@stripe/stripe-js": "2.1.11",
Here's how we import in our Angular component:
import { loadStripe } from '@stripe/stripe-js/pure';
Can you please support ESM modules?
Environment
No response
Reproduction
No response
The text was updated successfully, but these errors were encountered: