1

I am using VueJS and I've been bitten several times by the fact that it swallows all errors (undefined properties in templates as well as calling undefined errors in methods).

Is there a way to turn on all errors, or at least all errors happening in JS (and not in templates)?

5
  • 2
    Did you try using debug Vue.config.debug = true? With this Vue will print stacktrace errors/warnings. Commented Sep 20, 2016 at 14:38
  • 2
    Also ensure to be using the develpment version. From docs: "don’t use the minified version during development. You will miss out all the nice warnings for common mistakes!" Commented Oct 19, 2016 at 15:06
  • I'll use the debug option then. And thanks @ragnar. That will create a complex setup though (differentiating dev and prod), too bad exceptions are just swallowed out of the box :/ Commented Oct 20, 2016 at 6:37
  • Vue.config.debug doesn't exist in 2.0. I think you just want to NOT use the minified version and make sure you DON't set Vue.config.silent to true. Commented Oct 21, 2016 at 20:41
  • @BillCriswell thanks I've updated the answer Commented Oct 24, 2016 at 11:45

1 Answer 1

4

From the comments:

  • don't use the minified version in development

For VueJS 1.x:

  • turn on the "debug" mode (this doesn't exist in Vue 2.0 anymore)

    config: {
        debug: true
    }
    

    or Vue.config.debug = true

Sign up to request clarification or add additional context in comments.

2 Comments

How would you make sure that errors are properly logged to Sentry or Bugsnag in production (in case of bugs that have not been discovered while develping) ?
@conradk I honestly don't know, maybe you should ask that in a separate question to get answers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.