Using torii with FastBoot
See original GitHub issueI can’t seem to properly run this in a FastBoot app.
Torii works fine, but once I turn my app into FastBoot, I’m getting DOM requirement errors.
ReferenceError: document is not defined
There was an error running your app in fastboot. More info about the error:
ReferenceError: document is not defined
at loadScript (/tmp/broccoli_merge_trees-output_path-foo.tmp/assets/addon-tree-output/torii/providers/-private/utils.js:24:1)
at Ember.RSVP.Promise.then.window.fbAsyncInit (/tmp/broccoli_merge_trees-output_path-foo.tmp/assets/addon-tree-output/torii/providers/facebook-connect.js:34:1)
at initializePromise (/tmp/broccoli_merge_trees-output_path-foo.tmp/assets/rsvp.js:397:1)
at new Promise (/tmp/broccoli_merge_trees-output_path-foo.tmp/assets/rsvp.js:877:1)
at fbLoad (/tmp/broccoli_merge_trees-output_path-foo.tmp/assets/addon-tree-output/torii/providers/facebook-connect.js:26:1)
at Class.init (/tmp/broccoli_merge_trees-output_path-foo.tmp/assets/addon-tree-output/torii/providers/facebook-connect.js:84:1)
Ember 3.5
Torii 0.10.1
This is happening when I’m using the facebook-connect
adapter, but this.get('torii).open('facebook-connect')
is only fired within a user activated action
, so I don’t understand why facebook-connect.js
is running serverside (FastBoot) at all.
Is there a specific way this needs to be set up, or is the torii
plugin simply incompatible with FastBoot
?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8
Top Results From Across the Web
Is it possible to use Torii with FastBoot in Ember?
I'm using Torii 0.10.1 with Ember 3.5 in order to use facebook-connect by injecting the torii service into the controller.
Read more >Issues · Vestorly/torii - GitHub
A set of clean abstractions for authentication in Ember.js - Issues ... Vestorly / torii Public ... Using torii with FastBoot.
Read more >Why Japan's Tiniest Torii Gate is Dangerously Small - YouTube
To pass through a Torii gate is to pass through into a sacred world. Unfortunately, Japan's tiniest torii gate is so unbelievably small, ......
Read more >The 5 Things You Need to Know Before You Visit a Shrine
Here are five essential tips to get the most out of your visit to a Shrine. How to walk through a torii gate:...
Read more >temple 3d model free
Free 3D greek temple models for download, files in 3ds, max, c4d, ... Hindu Temple #Hindu #India #Temple. fastboot usage unknown reboot ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Future travelers using
torii
^0.10, you’re gonna want the fix below since it now eager loads the FB connect code in the init hook. Also to save you from the pain I just experienced, the fix above has a casing typo:isFastBoot
needs that very crucial capital B! 😅@Redsandro I got this to work on my end. You basically need to block against the
FacebookConnectProvider
not being available when the app boots in fastboot. Then, after it’s loaded the FacebookConnectProvider service will go through. Not sure what’s happening in thefetch()
call but something in that call breaks the build.Here’s what you need:
Add the following to
torii-providers/facebook-connect.js
Let me know any questions.