Vue: [Vue warn]: Property "x" was accessed during render but is not defined on instance
The template references a variable/function that the component doesn’t expose.
Seen on:
Vue
Meaning
In <script setup>, only top-level bindings are available to the template. Variables defined inside functions, typos, or Options API data not returned cause it.
Common causes
- Typo in the template variable name
- Variable not declared at top level in <script setup>
- Options API: missing in data()/computed/methods
- Not returned from setup()
⚡ Quick fix
- Declare the ref/function at the top level of <script setup>
- Fix the name
- Return it from setup() when not using <script setup>
Detailed fix by platform
Vue
- javascript
<script setup> import { ref } from "vue"; const count = ref(0); function increment() { count.value++; } </script>
How to diagnose
- Name — Which property?
- Scope — Declared at top level?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Avoid mutating a prop directly Vue: [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders
- Failed to resolve component Vue: [Vue warn]: Failed to resolve component: x
- NG8002 Angular: NG8002: Can't bind to 'ngModel' since it isn't a known property of 'input'
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026