Skip to content

script setup with extra render function does not render anything in production mode, but works in dev mode. #4980

@wxsms

Description

@wxsms

Version

3.2.22

Reproduction link

sfc.vuejs.org/

Steps to reproduce

<script setup>
import { ref } from 'vue'

const msg = ref('Hello World!')

defineExpose({msg})
</script>

<script>
import { h } from 'vue';

export default {
  render () {
    return h('div', {}, 'hello ' + this.msg)
  }
}
</script>

What is expected?

It should render hello Hello World! after build.

What is actually happening?

No error is reported, but It renders nothing after build. BUT renders hello Hello World! in dev mode (you may use the download button on sfc playground and try it).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions