Skip to content

Use of try/catch when using loadModule to catch errors in .vue files #103

Discussion options

You must be logged in to vote

I think I've just answered my own question, by looking at one of the examples. I needed to put this in my options object:

  log(type, ...args) {
    console.log(type, ...args);
  },

That produces a better console log, in addition to the syntax error:

error parse script ./components/add.vue
   8 |             sum.value = parseInt(num1.value) + parseInt(num2.value);
   9 |             alert(`The answer is ${sum.value}`)
> 10 |         },
     |          ^ Unexpected token (10:9)
  11 |         const equation = Vue.computed(() => {
  12 |             return `${num1.value} + ${num2.value}`
  13 |         });

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by FranckFreiburger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant