vuetifyjs / webpack-ssr

Vuetify Webpack SSR Template
https://vuetifyjs.com/overview
62 stars 28 forks source link

Render is not defined for production mode #17

Closed jayminpanchal closed 7 years ago

jayminpanchal commented 7 years ago

I have created the project using this template. Everything is working fine with development mode.

But when I run with the production environment I got this error:

ReferenceError: render is not defined
    at Object.<anonymous> (E:\Jaymin\Git\jayminpanchal\vue\vuetifydemo\server.js:137:23)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3

when I commented the below code in server.js file and its working:

 app.get('*', isProd ? render : (req, res) => {
    readyPromise.then(() => render(req, res))
 })

Do we need this code? or I should comment it?

johnleider commented 7 years ago

I'll have to look into it as the docs are run on this package and do not see the same issue. Is it possible that you could provide me with a repo clone that produces this error? Thank you.

jayminpanchal commented 7 years ago

I have given you repo link please clone it and run in production mode

https://github.com/jayminpanchal/vuetify-webpack-ssr

johnleider commented 7 years ago

Sure

johnleider commented 7 years ago

I'll be able to check it out Monday.

jayminpanchal commented 7 years ago

k no problem.

johnleider commented 7 years ago

I cloned, installed, ran dev to make sure it worked then ran build. Everything worked just fine, can you check one more time please?

jayminpanchal commented 7 years ago

When you run a command npm run build it will not give you any error. But when you run npm start after build it will prompt you the error

jayminpanchal commented 7 years ago

@johnleider have you found any solution to this problem or I should comment that portion

johnleider commented 7 years ago

I have no come back to this yet, I'll check tonight.

jayminpanchal commented 7 years ago

Ok. for now I have commented the code and continue with my work. But once you find it the solution then let me know

miyalee commented 7 years ago

@jayminpanchal @johnleider I had this problem too, when I checked the code, I found there is no 'render' in server.js, so I change server.js to this:

2017-07-11 2 30 52

then it working

johnleider commented 7 years ago

Can confirm that a method was missing, it is now present and this should be considered resolved. Sorry for the wait, thank you for your patience.