vuejs / vue-cli

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

can't render JSX component with defineComponent function #6234

Closed rockboom closed 3 years ago

rockboom commented 3 years ago

Version

4.5.11

Reproduction link

https://github.com/rockboom/test-vue3

Environment info

Environment Info:

  System:
    OS: macOS 10.15.7
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
  Binaries:
    Node: 12.13.1 - /usr/local/bin/node
    Yarn: 1.13.0 - /usr/local/bin/yarn
    npm: 6.12.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 87.0.4280.141
    Edge: Not Found
    Firefox: 69.0.1
    Safari: 14.0
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1 
    @vue/babel-helper-vue-transform-on:  1.0.2 
    @vue/babel-plugin-jsx:  1.0.2 
    @vue/babel-plugin-transform-vue-jsx:  1.2.1 
    @vue/babel-preset-app:  4.5.11 
    @vue/babel-preset-jsx:  1.2.4 
    @vue/babel-sugar-composition-api-inject-h:  1.2.1 
    @vue/babel-sugar-composition-api-render-instance:  1.2.4 
    @vue/babel-sugar-functional-vue:  1.2.2 
    @vue/babel-sugar-inject-h:  1.2.2 
    @vue/babel-sugar-v-model:  1.2.3 
    @vue/babel-sugar-v-on:  1.2.3 
    @vue/cli-overlay:  4.5.11 
    @vue/cli-plugin-babel: ~4.5.0 => 4.5.11 
    @vue/cli-plugin-eslint: ~4.5.0 => 4.5.11 
    @vue/cli-plugin-router:  4.5.11 
    @vue/cli-plugin-typescript: ~4.5.0 => 4.5.11 
    @vue/cli-plugin-vuex:  4.5.11 
    @vue/cli-service: ~4.5.0 => 4.5.11 
    @vue/cli-shared-utils:  4.5.11 
    @vue/compiler-core:  3.0.5 
    @vue/compiler-dom:  3.0.5 
    @vue/compiler-sfc: ^3.0.0 => 3.0.5 
    @vue/compiler-ssr:  3.0.5 
    @vue/component-compiler-utils:  3.2.0 
    @vue/eslint-config-typescript: ^5.0.2 => 5.1.0 
    @vue/preload-webpack-plugin:  1.1.2 
    @vue/reactivity:  3.0.5 
    @vue/runtime-core:  3.0.5 
    @vue/runtime-dom:  3.0.5 
    @vue/shared:  3.0.5 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue: ^7.0.0-0 => 7.5.0 
    typescript: ~3.9.3 => 3.9.7 
    vue: ^3.0.0 => 3.0.5 
    vue-eslint-parser:  7.4.1 
    vue-hot-reload-api:  2.3.4 
    vue-loader:  15.9.6 (16.1.2)
    vue-style-loader:  4.1.2 
    vue-template-es2015-compiler:  1.9.1 
  npmGlobalPackages:
    @vue/cli: 4.5.11

Steps to reproduce

1.npm run serve 2.open URL with browser

What is expected?

I want to see the content in visual.tsx can render in browser.

What is actually happening?

The component with defineComponent function can’t be seen in browser, the second component with annotation can be seen in browser.

LinusBorg commented 3 years ago

your render method doesn't return.