adopted-ember-addons / ember-stripe-elements

A simple Ember wrapper for Stripe Elements
https://ember-stripe-elements.netlify.com
MIT License
19 stars 23 forks source link

Lazy Loading is a Bit Wonky #3

Closed jherdman closed 4 years ago

jherdman commented 4 years ago

Version: 1.0.0-rc.1

When lazy loading Stripe I'm seeing the following error when things don't happen quickly enough:

Uncaught (in promise) TypeError: Ember.get(...) is not a function

This error points to this line:

https://github.com/adopted-ember-addons/ember-stripe-elements/blob/75cc51cf80415b5ccfb83472b2b4f7ef212bac3d/addon/components/stripe-element.js#L18

It seems that the proxying in the Stripe service isn't happening fast enough, and may need a default no-op function (or similar)?

I can work around this problem by lazy loading Stripe BEFORE I enter the route that displays my payment form. E.g. given the URL /checkout rendering in the Application route, and not the Checkout route — even the beforeModel in the Checkout route is insufficient.

jherdman commented 4 years ago

Apologies, this is my fault. I think I can whip up a documentation improvement to help other people with the lazy loading scenario though.