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

Stack traces display incorrect line numbers #259

Closed
RishabhKarnad opened this issue May 14, 2020 · 1 comment · Fixed by #249
Closed

Stack traces display incorrect line numbers #259

RishabhKarnad opened this issue May 14, 2020 · 1 comment · Fixed by #249
Labels
bug Something isn't working in-progress

Comments

@RishabhKarnad
Copy link
Contributor

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:

  1. Create SFC in .vue file
  2. Throw an error in the <script> part of the SFC and don't handle it
  3. 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>

Screenshots

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
@RishabhKarnad
Copy link
Contributor Author

This was referenced May 14, 2020
@RishabhKarnad RishabhKarnad removed their assignment Aug 24, 2020
@RishabhKarnad RishabhKarnad added help wanted Extra attention is needed bug Something isn't working and removed in-progress labels Aug 24, 2020
@RishabhKarnad RishabhKarnad added in-progress and removed help wanted Extra attention is needed labels Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in-progress
Projects
None yet
1 participant