vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.75k stars 6.33k forks source link

Can't use compeonnt from another file #6513

Closed kumaresan-subramani closed 3 years ago

kumaresan-subramani commented 3 years ago

Version

4.5.10

Reproduction link

https://github.com/kumaresan-subramani/Vue3-template-check

Environment info

"vue": "^3.0.5",
    "vue-class-component": "^8.0.0-rc.1",
    "vue-template-compiler": "^2.6.11"
"@vue/cli-plugin-babel": "^4.5.10",
    "@vue/cli-plugin-eslint": "^4.5.10",
    "@vue/cli-service": "^4.5.10",
    "@vue/compiler-sfc": "^3.0.5",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.8.0",
    "eslint-plugin-vue": "^7.4.1",
    "vue-loader-v16": "^16.0.0-beta.5.4"

Steps to reproduce

https://github.com/kumaresan-subramani/Vue3-template-check

https://stackblitz.com/edit/vue-s4fpy3?file=package.json

What is expected?

Need to redner compeonnt form another file

What is actually happening?

But it not renderign properly

kumaresan-subramani commented 3 years ago

@sodatea - can you sugegst on this

haoqunjiang commented 3 years ago

https://github.com/kumaresan-subramani/Vue3-template-check/blob/fc962ebda6488ea453196725a927876b7f95972c/src/App.vue#L26

- import { HelloWorld } from "./components/HelloWorld";
+ import HelloWorld from "./components/HelloWorld.vue";
  1. Don't omit the .vue extension
  2. It's the default export
kumaresan-subramani commented 3 years ago

@sodatea , even after changing this same issue occurs

haoqunjiang commented 3 years ago

What issue? I don't see any errors on my machine. The app renders as expected: image

kumaresan-subramani commented 3 years ago

Still not working for me

Is there any limitation like node version vue version etc?

haoqunjiang commented 3 years ago

What's your node version? And what's the error?

kumaresan-subramani commented 3 years ago

@sodatea ,

node - 10.15.1

it is wokring fine when i use yarn install to install node modules