-
Notifications
You must be signed in to change notification settings - Fork 292
Closed
Labels
Description
Description of the bug
If an error is thrown in a Vue SFC, the line number of the statement that threw the error is incorrect.
To Reproduce
Steps to reproduce the behaviour:
- Create SFC in .vue file
- Throw an error in the
<script>
part of the SFC and don't handle it - View the stack trace in the error screen on the device/simulator or in the debugging tools
What I expected
The line number should match the line number in the user's source code
Code sample
<script>
export default {
data() {
return {
message: 'Hello',
};
},
methods: {
p() {
this.message += '!';
},
},
mounted() {
function t() {
throw new Error('Mock error'); // line 15
}
t(); // line 17
console.log(10 < 20);
},
};
</script>
<template>
<view class="container">
<text class="text-color-primary">My Vue Native App</text>
<text class="text-color-primary">{{ message }}</text>
<button title="Press" @press="p" />
</view>
</template>
<style>
.container {
background-color: white;
align-items: center;
justify-content: center;
flex: 1;
}
.text-color-primary {
color: blue;
}
</style>
Did I use vue-native-cli
to create the project?
Yes
Am I using Expo?
Yes, although it also occurs on bare RN based projects
Development platform:
- OSX Catalina 10.15.4
- ZSH
The device on which I run my Vue Native app
- Device: any iPhone or Android device
- OS: all supported variants