Open aldeed opened 9 years ago
same error here…
@aldeed did you find a fix for this issue?
No. Removed spiderable for now.
Spiderable was working on my local server. I've just uploaded to a digital ocean server using mup (with the option to install PhantomJS set to true) and I'm also seeing this error.
Can anyone help solve this?
Same issue here..
Anyone figured this out yet? Or have a workaround?
Eventually it didn't have much to do with iron router, but with some client-side javascript errors that crashed phantomjs, make sure there are no client-side javascript errors whatsoever.
Strange...no client-side errors for me at all but still the same issue!
Ok I found what I think was causing the issue for me — it looks like when I take away all my external <script>
tags in my <head>
, the error disappears. But that means I'm unable to load typekit, google analytics, etc. which is problematic...
I ran into the same problem and it drove me crazy. Removing the <script>
tags in the header of my html solve the problem. I have typekit and ga too. You just have to add this in your app.js (or whatever fires first) :
( function ( i, s, o, g, r, a, m ) {console.log( arguments ); i[ 'GoogleAnalyticsObject' ] = r; i[ r ] = i[ r ] || function () {( i[ r ].q = i[ r ].q || [] ).push( arguments ); }, i[ r ].l = 1 * new Date(); a = s.createElement( o ), m = s.getElementsByTagName( o )[ 0 ]; a.async = 1; a.src = g; m.parentNode.insertBefore( a, m ); } )( window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga' );
ga( 'create', 'xxx', 'auto' );
ga( 'send', 'pageview' );
// Load the fonts
$.getScript( '//use.typekit.net/xxx.js', function () {
try {
Typekit.load();
} catch ( e ) {}
} );
Well.. actually, it did not solved my problem. Back to crazy :(
Everything used to work perfectly fine until two weeks ago (the application is deployed on modulus, works fine in local)
@fabien-h I tried out your solution with several scripts moved from my <head>
tag into my compatibility folder. It is now working with GA, heap analytics, and zopim, but Typekit seems to be the real issue here. Once I remove typekit, escaped fragment seems to work without any issues.
hum, that will be a problem...
Do you know how to check if the page is rendered by the client or by phantom js ?
seeing the same error. even when i remove everything from the <head>
tag. earlier on an @import
statement in my css caused the same error btw, but also on localhost with --production
. the site is deployed on myApp.meteor.com. did anyone manage to solve the issue yet? on a side note, could this be related to the fiber issue #1192 ?
Seems working on my config with iron:router@1.0.12
I'm running into the same issue. In my particular case I'm using both the spiderable package (for rendering the majority of the pages on my site to web crawlers), and the meteorhacks:ssr
package in conjunction with the iron-router where: 'server'
option (for rendering two specific routes that must be rendered on the server every time).
I followed the code back through the stack trace and it looks like an issue in the RouteController.lookupOption
function. I believe the issue is that, for some reason, the CurrentOptions
environmental variable is not set when the lookupOptions
function is called. So, when the following line is executed, an error is thrown:
var opts = CurrentOptions.get();
I copied an pasted all of the code for the RouteController.prototype.lookupOption
function into my project and wrapped the code that checks for the current options in an if
statement to check to see if the CurrentOptions
variable is undefined, and it no longer throws the fibers error.
// see if we have the CurrentOptions dynamic variable set.
if (typeof CurrentOptions !== 'undefined') {
var opts = CurrentOptions.get();
if (opts && _.has(opts, key))
return opts[key];
}
I still get the following error at the cli, but the page renders:
spiderable: phantomjs failed at http://localhost:3000/ns: { [Error: Command failed: ] killed: true, code: 1, signal: null }
Seeing this error with every spiderable request using latest iron:router (1.0.6).
Is it something in one of my router hooks? What's the best way to debug this?