core icon indicating copy to clipboard operation
core copied to clipboard

Blank screen and Vue warning with hot reloading

Open liamdebeasi opened this issue 5 years ago • 15 comments

Version

3.2.13

Reproduction link

github.com

Steps to reproduce

  1. Clone attached repo and run npm install.
  2. Run npm run serve.
  3. Open the app in the browser. You should see a page that says "Hello World!".
  4. Open App.vue and save the file.
  5. Observe that the browser page is now blank and there is a warning in the console that says [Vue warn]: Component is missing template or render function. at <App>

What is expected?

I would expect the app to still show up and for there to be no warning.

What is actually happening?

The app disappears and there is a warning.


Other devs on the Vue forum are running into this issue: https://forum.vuejs.org/t/vue-3-fresh-project-hot-reload-resulting-in-component-is-missing-template-or-render-function/121884

liamdebeasi avatar Sep 22 '21 15:09 liamdebeasi

I got the same problem with the latest version.

dsine-de avatar Sep 22 '21 15:09 dsine-de

Same issue here...

Sun3 avatar Sep 22 '21 16:09 Sun3

This is a regression caused by [email protected]+. For now, please pin vue-loader to 16.5.x (e.g. using Yarn's resolution field)

yyx990803 avatar Sep 22 '21 21:09 yyx990803

Should be fixed in [email protected].

yyx990803 avatar Sep 22 '21 22:09 yyx990803

I am new to Vue, how would you pin vue-loader to 16.5.x ? I am using npm.

Thank you.

Sun3 avatar Sep 23 '21 03:09 Sun3

应该固定在[email protected]. 我固定在[email protected]无效,还是报这警告,并且页面空白。这是我package-lock.json的截图: image 以及查看node_modules文件夹下安装的vue-loader的package.json截图: image

long-hai-yang avatar Sep 23 '21 06:09 long-hai-yang

When is a vue-loader version bump in @vue/cli-service expected @yyx990803 ? I'm afraid that there's no straightforward solution for npm as for yarn (except downgrading)

epaezrubio avatar Sep 23 '21 12:09 epaezrubio

@long-hai-yang @Sun3 You can refer to this answer https://stackoverflow.com/questions/15806152/how-do-i-override-nested-npm-dependency-versions

WJCHumble avatar Sep 24 '21 02:09 WJCHumble

@epaezrubio you can always remove the lockfile and re-install to force latest version.

yyx990803 avatar Sep 24 '21 03:09 yyx990803

It's working again for me...

I reinstalled vue cli via npm install -g u/vue/cli then deleted my projects package-lock.json file. Then from the project, I ran npm install and the hot reload is working again.

Sun3 avatar Sep 24 '21 18:09 Sun3

Still an issue with a Vue CLI scaffolded project and vue-loader 16.8.2.

lloydjatkinson avatar Nov 27 '21 15:11 lloydjatkinson

Still not solved,With the latest cli, or this problem @yyx990803

WechatIMG163 WechatIMG162

Tommychou avatar Nov 29 '21 05:11 Tommychou

still blank screen when use vue-loader 16.8.1,and console warn Component is missing template or render function

FeiFanLiang avatar Dec 29 '21 07:12 FeiFanLiang

I find that when making changes to components that have a v-if or v-show condition on them (for example a dropdown menu), and I make some changes to a nested component, this will hot-reload fine when the component is visible. But if I then toggle the visibility of the parent component to hide it and then show it again, Vue will render an empty component.

Only fix is to refresh the page.

Not sure if it is the same issue as the one described here, as there is no error in the console, but it's a similar problem and also requires a refresh to fix it.

adamreisnz avatar Jan 04 '22 01:01 adamreisnz

Should be fixed in [email protected].

But, when I use [email protected], it still warns.

HHN0609 avatar May 02 '22 14:05 HHN0609