vuejs / vue

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
http://v2.vuejs.org
MIT License
207.95k stars 33.67k forks source link

vue-server-render: when the serverCacheKey option is a string,there is no error or tip #6162

Closed maunier closed 7 years ago

maunier commented 7 years ago

Version

2.3.4

Reproduction link

https://github.com/zhaorui19910121/my-blog/blob/master/src/views/App.vue

Steps to reproduce

The link is my demo to learn vue ssr. Clone and npm install -> modify the serverCacheKey options in App.vue to a string -> npm start -> localhost: 3000

What is expected?

There should an error or a tip show in the terminal, but there is nothing.

What is actually happening?

Nothing is rendered in my browser, and there is no error or tip in my terminal. I don't know what happened. It need much time to debug.


I think the source code in vue-server-render/build.js:

var key = name   '::'   getKey(node.componentOptions.propsData);

should throw an error, but i don't know why it doesn't.

yyx990803 commented 7 years ago

There is an error if you add proper error handling.

screen shot 2017-07-19 at 7 35 30 am