Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template ref with conflicting name works in dev but not in prod #6964

Closed
Florent-Bouisset opened this issue Oct 26, 2022 · 1 comment · Fixed by #6975
Closed

Template ref with conflicting name works in dev but not in prod #6964

Florent-Bouisset opened this issue Oct 26, 2022 · 1 comment · Fixed by #6975
Labels
🐞 bug Something isn't working scope: compiler

Comments

@Florent-Bouisset
Copy link

Vue version

3.2.41

Link to minimal reproduction

https://sfc.vuejs.org/#eNp9UctOwzAQ/BXLl4LU2ApwikJVhIQ4InH1JTSbB8QPrZ0iFOXfWSehKkH05t2Z3VnPDPzBOXHsgWc89wdsXWAeQu92yrTaWQzs0WrHKrSabYSMRaRvlMnlzCcmFQG064oAVDGWTzPa1/eKP1mr+C6fJgnM5YnJt3yWSHThxLu3ho4Y4rxaAK94xqZO7JFsrBVvQnA+k7I37qMWB6vlnjCJvQmthqS0en8rbsRdKsvWh/O+AK+TN7SfHpAUFd+eLZfUPAImCKYEBLwotuL+Elxhf0Sj5qjMSAb8+Pm//QNDqNi4JDBbr2hx1Rp4Qev81WQQmX2yKnw5yNhrwNbUyweJX/RdyNhmeTEN3hd13DYfc3050SaNd1CeJER5PkPX2Vw26SrS8RusPMwX

Steps to reproduce

  • Create a component with a template named the same as a prop
<script setup>
import { ref } from 'vue'

defineProps({
  msg: {
    type: String,
    default: 'default message'
  }
})
</script>


<template>
  <h1 ref="msg">Hello</h1>
</template>
  • Run the app in dev
  • Build the app and run in prod

What is expected?

It should work or not but it should have same behavior between dev and prod mode

What is actually happening?

It work in dev mode
It doesn't work in prod with an error msg is not defined making it a bit difficult to debug

System Info

No response

Any additional comments?

No response

@edison1105 edison1105 added 🐞 bug Something isn't working scope: compiler labels Oct 27, 2022
yyx990803 pushed a commit that referenced this issue Nov 9, 2022
chrislone pushed a commit to chrislone/core that referenced this issue Feb 4, 2023
zhangzhonghe pushed a commit to zhangzhonghe/core that referenced this issue Apr 12, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working scope: compiler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants