Skip to content
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

Fastboot Support #20

Open
rydn opened this issue Mar 15, 2017 · 3 comments
Open

Fastboot Support #20

rydn opened this issue Mar 15, 2017 · 3 comments

Comments

@rydn
Copy link

rydn commented Mar 15, 2017

Currently if we run fast boot with this module included the following error occurs:

Error while processing route: main Cannot read property 'getScript' of undefined TypeError: Cannot read property 'getScript' of undefined
    at FBInit.fbInitPromise._ember.default.RSVP.Promise.then.window.fbAsyncInit (/home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/vendor.js:73010:28)
    at initializePromise (/home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/vendor.js:69123:7)
    at new Promise (/home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/vendor.js:69611:33)
    at Class.FBInit (/home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/vendor.js:73005:28)
    at Class.beforeModel (/home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/stage-360-preregistration.js:577:26)
    at applyHook (/home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/vendor.js:66590:28)
    at C.runSharedModelHook (/home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/vendor.js:67209:18)
    at C.runBeforeModelHook (/home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/vendor.js:67182:17)
    at /home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/vendor.js:66446:15
    at tryCatch (/home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/vendor.js:69073:14)
    at invokeCallback (/home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/vendor.js:69088:15)
    at publish (/home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/vendor.js:69056:9)
    at /home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/vendor.js:48960:16
    at invokeWithOnError (/home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/vendor.js:10889:16)
    at Queue.flush (/home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/vendor.js:10948:9)
    at DeferredActionQueues.flush (/home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/vendor.js:11072:15)
    at Backburner.end (/home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/vendor.js:11142:23)
    at Timeout._onTimeout (/home/ryan/Dev/Projects/stage-360-preregistration/dist/fastboot/vendor.js:11708:16)
    at ontimeout (timers.js:365:14)
    at tryOnTimeout (timers.js:237:5)
    at Timer.listOnTimeout (timers.js:207:5)

Is this the facebook sdk assuming its in a browser or is this the module making the call to getScript?

@bugant
Copy link
Member

bugant commented Mar 15, 2017

@rydn this is the FB JS SDK trying to do the init, so yes it need to be in a browser. So here the problem is that someone is calling the FBInit function (https://github.com/pitchtarget/ember-cli-facebook-js-sdk/blob/master/addon/services/fb.js#L6). Please, let me know how can I help to solve the issue.

@rydn
Copy link
Author

rydn commented Mar 16, 2017

@bugant Assuming the Facebook SDK isn't touching browser specific stuff it would it not be possible to use something like ember-network and then eval'ing the returned text, seems unlikely to me.

Alternatively, why can't it just check isFastboot from the fast boot service?

@joelalejandro
Copy link
Contributor

@rydn @bugant Otherwise, is it possible to set FB = { skipInit: true} from the config/environment if the app's rendering in fast boot mode?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants