Webpack: server-side rendering really is not working

Created on 19 Nov 2016  ·  6Comments  ·  Source: vuejs-templates/webpack

Hello , Vuejs Engineers! Could you please tell me why i can't see "server-rendered="true""?
i make sure that correctly use your webpack template ! "npm install" is ok! "npm run dev" is ok !
ssr

Most helpful comment

@anlexN I'm not a maintainer of this project. For future reference, It's inappropriate to just mention random contributors to help you with a problem.

All 6 comments

please reply me as soon as possible..... @jbruni @ianwalter @guidobouman @pksunkara @anvaka @everyone

Well, it seems PRETTY urgent to you and since no body has replied yet, so I am replying here.

First of all, this template webpack doesn't support server side rendering. What you were running is webpack's dev server.

Second, if you want to check out server side rendering, use this example https://github.com/vuejs/vue-hackernews-2.0.

Third, the correct way to check if the page is server-rendered is

Once you have it running locally, you can confirm that server-side rendering really is working by right-clicking on the page and selecting View Page Source (or similar). You should see this in the body: <div id="app" server-rendered="true">You have been here for 0 seconds&period;</div> instead of: <div id="app"></div>

As it is said here https://vuejs.org/v2/guide/ssr.html#Simple-SSR-with-the-Express-Web-Server.

screen shot 2016-11-19 at 11 44 16 pm

@anlexN I'm not a maintainer of this project. For future reference, It's inappropriate to just mention random contributors to help you with a problem.

This template doesn't include server-side rendering - I'm not sure where you got the impression that it does.

There is currently no official template for server-side rendering, because SSR has a lot to do with your server setup and how your app is structured. The official reference implementation is https://github.com/vuejs/vue-hackernews-2.0

And as @ianwalter pointed out: it's inappropriate to just mention random contributors to help you with a problem.

@yyx990803 @jamesjieye , because of vue-hackernews-2.0 's diffcults, i don't like it! Could you please tell me how to do that this template webpack does support server side rendering?

因为这个项目只是一个vue单页项目的模板,服务器渲染更多需要服务器端的代码去配合,并不适合做一个生成模板。如果需要项目的架构可以去参考vue-hacknews-2.0。

Was this page helpful?
0 / 5 - 0 ratings