Skip to content
This repository has been archived by the owner on Oct 9, 2019. It is now read-only.

Error running ember-prerender #37

Open
teckays opened this issue Dec 29, 2015 · 4 comments
Open

Error running ember-prerender #37

teckays opened this issue Dec 29, 2015 · 4 comments

Comments

@teckays
Copy link

teckays commented Dec 29, 2015

I'm having this error when trying to access http://localhost:3000

Renderer 0] Restarting rendering engine in 25000 seconds after it failed with error: Phantom encountered an error: TypeError: 'undefined' is not a function (evaluating 'this.window.console.error.bind(this.window.console)')
@Lesterpaintstheworld
Copy link

I have the same problem, have been trying quite a few things (see: http://stackoverflow.com/questions/33895504/ember-pre-render-typeerror-undefined-is-not-a-function-evaluating-u-binde )

@teckays
Copy link
Author

teckays commented Jan 6, 2016

@NicoRR I gave up on this module. After countless errors I was able to somehow make it work, (can't tell how exactly because it just "magically" happened), anyway, after playing around I would say that for now it's way too slow because of the "on-the-fly" rendering and stuff. You would definitely not want to use it in production as some requests took me 7-10 seconds to render (and this happened on a server with 256GB of RAM).

I'm currently working on a very interesting module https://github.com/polyzor/ember-backend, the idea is pretty simple, create a server side wrapper of an ember application and serve this for bots. The module is written on top of Total.js which is an awesome backend framework. I expect it to be done in 2-3 days (basic functionality). If interested, you can fork, change, adapt and contribute, etc.

I have some additional code I didn't push just yet, if needed, just let me know and I'll update the repo.

@tha022
Copy link

tha022 commented Jan 12, 2017

Hi, I have the same issue as above. Any solutions to it?

When I run the
$ ember-prerender ember-prerender-config.js

I get the following error in return. Anyone encountered this one? Thanks in advance.

2017-01-11T18:07:30.889Z [Renderer 0] Engine starting up (phantom)
phantom stdout: Incompatibile SockJS! Main site uses: "0.3.1.7.ga67f.dirty", the iframe: "0.3.4".

2017-01-11T18:07:32.018Z [Renderer 0] Restarting rendering engine in 25000 seconds after it failed with error: Phantom encountered an error: TypeError: 'undefined' is not a function (evaluating 'this.window.console.error.bind(this.window.console)') 
2017-01-11T18:07:33.229Z [Renderer 0] >>> DEBUG: -------------------------------
2017-01-11T18:07:33.261Z [Renderer 0] >>> DEBUG: Ember             : 2.8.3
2017-01-11T18:07:33.261Z [Renderer 0] >>> DEBUG: Ember Data        : 2.11.0
2017-01-11T18:07:33.261Z [Renderer 0] >>> DEBUG: jQuery            : 2.2.4
2017-01-11T18:07:33.261Z [Renderer 0] >>> DEBUG: Ember Simple Auth : 1.1.0-beta.3
2017-01-11T18:07:33.261Z [Renderer 0] >>> DEBUG: -------------------------------
2017-01-11T18:07:33.261Z [Renderer 0] >>> Attempting URL transition to /
2017-01-11T18:07:33.261Z [Renderer 0] >>> Preparing to transition from '' to 'index'
2017-01-11T18:07:33.261Z [Renderer 0] >>> Transition #0: application: calling beforeModel hook
2017-01-11T18:07:33.262Z [Renderer 0] >>> Transition #0: application: calling deserialize hook
2017-01-11T18:07:33.262Z [Renderer 0] >>> Transition #0: application: calling afterModel hook
2017-01-11T18:07:33.262Z [Renderer 0] >>> Transition #0: index: calling beforeModel hook
2017-01-11T18:07:33.262Z [Renderer 0] >>> routes/sessions.js. transition = Transition (sequence 0)
2017-01-11T18:07:33.262Z [Renderer 0] >>> Attempting transition to sessions.login
2017-01-11T18:07:33.262Z [Renderer 0] >>> Transition #0: index: transition was aborted
2017-01-11T18:07:33.262Z [Renderer 0] >>> Transition #1: sessions: calling beforeModel hook
2017-01-11T18:07:33.262Z [Renderer 0] >>> Transition #1: sessions: calling deserialize hook
2017-01-11T18:07:33.262Z [Renderer 0] >>> Transition #1: sessions: calling afterModel hook
2017-01-11T18:07:33.262Z [Renderer 0] >>> Transition #0: detected abort.
2017-01-11T18:07:33.262Z [Renderer 0] >>> Transition #1: sessions.login: calling beforeModel hook
2017-01-11T18:07:33.262Z [Renderer 0] >>> Transition #1: sessions.login: calling deserialize hook
2017-01-11T18:07:33.262Z [Renderer 0] >>> Transition #1: sessions.login: calling afterModel hook
2017-01-11T18:07:33.262Z [Renderer 0] >>> Transition #1: Resolved all models on destination route; finalizing transition.
2017-01-11T18:07:33.262Z [Renderer 0] >>> Transitioned into 'sessions.login'
2017-01-11T18:07:33.262Z [Renderer 0] >>> Transition #1: TRANSITION COMPLETE.
2017-01-11T18:07:36.999Z [Renderer 0] >>> Unexpected response code: 400
2017-01-11T18:07:37.028Z [Renderer 0] Restarting rendering engine in 25000 seconds after it failed with error: Phantom encountered an error: TypeError: 'null' is not an object (evaluating 'e.request.uuid') 
2017-01-11T18:07:37.130Z [Renderer 0] >>> Unexpected response code: 400
2017-01-11T18:07:37.160Z [Renderer 0] Restarting rendering engine in 25000 seconds after it failed with error: Phantom encountered an error: TypeError: 'null' is not an object (evaluating 'e.request.uuid') 

This is the config file

module.exports = {
    // The port that prerender runs on (Phantom will use additional ports)
    port: 3000,

    // Process number (starting from 0) which is added to the above port, used when running multiple instances
    processNum: 0,

    // Can be: jsdom, phantom, or webdriver
    engine: "phantom",
    //engine: "webdriver",

    // Milliseconds to wait after the page load but before getting the HTML
    contentReadyDelay: 0,

    // Maximum milliseconds to wait before the initial app load times out
    initializeTimeout: 25000,

    // Maximum milliseconds to wait before a render job times out
    renderTimeout: 15000,

    // Maximum number of requests a worker can handle before it's restarted
    maxRequestsPerRenderer: 200,

    // Whether to restart a renderer gracefully or exit the process after reaching maxRequestsPerRenderer
    // Note: Exiting the process and having something like supervisor automatically restart it can
    //       help avoid memory leaks which seems to affect the JSDOM engine
    //       This could be investigated with: https://github.com/lloyd/node-memwatch
    exitAfterMaxRequests: false,

    // If exitAfterMaxRequets is true, setting this to true will cause all
    // queued requests to be rendered before the process is terminated
    gracefulExit: true,

    // Maximum number of rendering requests to queue up before dropping new ones
    maxQueueSize: 1000,

    // Your app's default URL
    appUrl: "http://localhost",

    // Serve static files
    serveFiles: true,

    // Log requests for static files
    serveFilesLog: true,

    // Regular expression of static file patterns
    filesMatch: /\.(?:css|js|jpg|png|gif|ico|svg|woff|woff2|ttf|swf|map)(?:\?|$)/,

    // Regular expression containing assets you don't want to download or process
    ignoreAssets: /google-analytics\.com|fonts\.googleapis\.com|typekit\.com|platform\.twitter\.com|connect\.facebook\.net|apis\.google\.com|\.css(?:\?|$)/,

    logging: {
        // Logging verbosity
        "level": "debug",

        // Add a timestamp to logs
        "timestamp": true,

        // Add color formatting to logs
        "format": true
    },

    // Available plugins:
    plugins: [
        "removeScriptTags",
        "httpHeaders",
        //"prepareEmail",
        //"prettyPrintHtml",
        //"minifyHtml",
        //"inMemoryHtmlCache",
        //"s3HtmlCache",
        //require('./your-own-plugin.js')
    ]
};

@Lesterpaintstheworld
Copy link

I unfortunately personally ended up using a service to do that (Prerender.io).

Good luck!

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

No branches or pull requests

3 participants