ReferenceError: document is not defined
adambedford opened this issue · 2 comments
adambedford commented
I'm getting a ReferenceError: document is not defined
error when loading a route with Fastboot that lazy loads Stripe.
Any pointers would be welcomed!
snewcomer commented
@adambedford Do you protect loading stripe in FastBoot? In a node environment, there is no document.
I'm guessing you want to wait until the browser takes over to get the stripe service (can't do anything with it in node anyways)
if (this.fastboot.isFastBoot) {
return this.get('stripe').load();
}
https://github.com/ember-fastboot/ember-cli-fastboot#fastboot-service
Let me know if you have other questions!
adambedford commented
🙌 You were absolutely right!