Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember pre-render: TypeError: 'undefined' is not a function (evaluating 'u.bind(e)')

I am trying to create a pre-render server for my ember app.

I installed ember-prerender (https://github.com/zipfworks/ember-prerender), used the initializers provided in the /example, deployed it on one of my servers.

But when I try to launch it:

[Renderer 0] Engine starting up (phantom)
[Renderer 0] Restarting rendering engine in 25000 seconds after it failed
             with error: Phantom encountered an error: TypeError: 
             'undefined' is not a function (evaluating 'u.bind(e)') 

I'm unsure where to look. I tried:

  • Deleting all third-party SDK (Facebook, Google Analytics)
  • Logging different parts of the code (the event XContentReady seems to be fired)
  • Launching with the engine jsdom instead of phantom (gives: [Renderer 0] Restarting renderer, timed out while initializing)
  • Trying in production

I don't know where too look at now. The worse part is that I had it working a few days ago (see: Ember pre-render: timed out while initializing)

EDIT:

I don't think that the problem has anything to do with the code, since I did a hard reset to a version that used to work.

  • Maybe some version changed (bower, npm, phantom)? I tried to update bower to 1.6, no success.
  • Maybe I have new dependencies that cause the problem? I don't see exactly how though

EDIT2: I started fresh on a new server, now I get Phantom crashing with this error message:

[Renderer 0] Restarting rendering engine in 25000 seconds
after it failed with error: Erroneous exit code: null SIGSEGV

If I use JSDOM I still get the Restarting renderer, timed out while initializing

EDIT 3: I tried to include a polyfill in my app. Using:

  • github.com/es-shims/es5-shim
  • then as an addon: github.com/pixelhandler/ember-cli-es5-shim

With no success

EDIT 4: I'm having the same error with a brand new project, containing only ember-prerender, so I'm thinking it's either linked to my particular build (version: 1.13.13, node: 0.12.3, npm: 2.14.10, os: linux x64), or my computer packages/configuration.

like image 878
Nicorr Avatar asked Nov 09 '22 01:11

Nicorr


1 Answers

I don't have experience with jsdom, but Function.prototype.bind is not supported with [email protected] and lower. Have you tried [email protected]?

like image 96
Garrett Murphey Avatar answered Jan 04 '23 01:01

Garrett Murphey