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

Make fastboot guard #26

Merged
merged 3 commits into from
Jul 11, 2016
Merged

Conversation

tschoartschi
Copy link

I implemented a simple fastboot guard so that the fastboot server can start and is not crashing while booting. I tried to implement a fixed base on the following discussions: ember-fastboot/ember-cli-fastboot#105 and plusacht/ember-bootstrap-datetimepicker#75

@kennethkalmer
Copy link
Owner

Thanks for this! Could you help me understand how to verify the issue so I can understand the fix? I've been thinking about fastboot lately, so this is a great way to get in :)

@tschoartschi
Copy link
Author

When I started my app with ember fastboot, I got the following error:

TypeError: Cannot read property 'pointerEnabled' of undefined
    at .../fastboot-dist/fastboot/bower_components/nouislider/distribute/nouislider.js:135:1
    at .../fastboot-dist/fastboot/bower_components/nouislider/distribute/nouislider.js:26:1
    at .../fastboot-dist/fastboot/bower_components/nouislider/distribute/nouislider.js:29:1
    at Sandbox.VMSandbox.eval (.../node_modules/ember-fastboot-server/lib/sandboxes/vm.js:14:14)
    at new EmberApp (.../node_modules/ember-fastboot-server/lib/ember-app.js:41:11)
    at new FastBootServer (.../node_modules/ember-fastboot-server/lib/server.js:33:14)
    at .../node_modules/ember-cli-fastboot/lib/commands/fastboot.js:32:22
    at lib$rsvp$$internal$$tryCatch (.../node_modules/rsvp/dist/rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (.../node_modules/rsvp/dist/rsvp.js:1048:17)
    at lib$rsvp$$internal$$publish (.../node_modules/rsvp/dist/rsvp.js:1019:11)
    at lib$rsvp$asap$$flush (.../node_modules/rsvp/dist/rsvp.js:1198:9)
    at _combinedTickCallback (node.js:370:9)
    at process._tickCallback (node.js:401:11)

This basically means that nouislider.js uses some functionality which is not available on server side rendering. My fix just excludes all libraries which are not available in fastboot mode. Maybe you could write some polyfills but for our app it was/is sufficient to just exclude things which do not work on the server.

Does this make sense?

@kennethkalmer
Copy link
Owner

Makes perfect sense! Will have to see how it can be added to the tests as
well.
On Mon, 09 May 2016 at 12:37 PM tschoartschi notifications@github.com
wrote:

When I started my app with ember fastboot, I got the following error:

TypeError: Cannot read property 'pointerEnabled' of undefined
at .../fastboot-dist/fastboot/bower_components/nouislider/distribute/nouislider.js:135:1
at .../fastboot-dist/fastboot/bower_components/nouislider/distribute/nouislider.js:26:1
at .../fastboot-dist/fastboot/bower_components/nouislider/distribute/nouislider.js:29:1
at Sandbox.VMSandbox.eval (.../node_modules/ember-fastboot-server/lib/sandboxes/vm.js:14:14)
at new EmberApp (.../node_modules/ember-fastboot-server/lib/ember-app.js:41:11)
at new FastBootServer (.../node_modules/ember-fastboot-server/lib/server.js:33:14)
at .../node_modules/ember-cli-fastboot/lib/commands/fastboot.js:32:22
at lib$rsvp$$internal$$tryCatch (.../node_modules/rsvp/dist/rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (.../node_modules/rsvp/dist/rsvp.js:1048:17)
at lib$rsvp$$internal$$publish (.../node_modules/rsvp/dist/rsvp.js:1019:11)
at lib$rsvp$asap$$flush (.../node_modules/rsvp/dist/rsvp.js:1198:9)
at _combinedTickCallback (node.js:370:9)
at process._tickCallback (node.js:401:11)

This basically means that nouislider.js uses some functionality which is
not available on server side rendering. My fix just excludes all libraries
which are not available in fastboot mode. Maybe you could write some
polyfills but for our app it was/is sufficient to just exclude things which
do not work on the server.

Does this make sense?


You are receiving this because you commented.

Reply to this email directly or view it on GitHub
#26 (comment)

Kenneth Kalmer
@kennethkalmer
http://www.opensourcery.co.za

@tschoartschi
Copy link
Author

@kennethkalmer I accidentally put the fastboot guard into the wrong file. With my latest commit I switched the guard to index.js. If you have any questions let me know

@Ramblurr
Copy link

Any update on this?

@kennethkalmer kennethkalmer merged commit 0e547dd into kennethkalmer:master Jul 11, 2016
@kennethkalmer
Copy link
Owner

Thanks for this and sorry for letting it sit. Will prepare a patch release shortly

@kennethkalmer
Copy link
Owner

I just released 0.10.0, could you please let me know if there are any regressions?

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

Successfully merging this pull request may close these issues.

3 participants