You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone! I'd like to discuss a feature request for Vue and it's ability to do catch errors and warnings when they occur on the server-side. I've done research on this topic but it doesn't seem to be possible as of the moment to catch warnings/errors with Vue when using renderToString.
The errorHandler and warnHandler seem not to be working as I do not see my custom console logs. I've also tried attaching these same handlers to Vue itself but it seems to complain that these do not even exist on the Vue instance and throws as en error.
I've also tried the errorCaptured and the warningCaptured lifecycle hook and it doesn't seem to work either. The issue as of right now is that all errors that happen with the template will get outputted to the console.
Let's consider this as an example:
render('{{vars.hello}}');
Example above will work just fine as vars.hello is defined and it'll show world as expected.
If we consider the following as an example, is where we will run into some issues:
render('{{vars.hello}} {{vars.test}}');
vars.test is not defined and it will show nothing, but the issue here is that the error/warning is outputted in the console. Is there any way to get the error be shown in the template itself or somehow in the code with a setup like this? From what I've researched, it does not seem possible.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello everyone! I'd like to discuss a feature request for Vue and it's ability to do catch errors and warnings when they occur on the server-side. I've done research on this topic but it doesn't seem to be possible as of the moment to catch warnings/errors with Vue when using renderToString.
Here's an example of my use case:
What I've tried so far:
The
errorHandler
andwarnHandler
seem not to be working as I do not see my custom console logs. I've also tried attaching these same handlers to Vue itself but it seems to complain that these do not even exist on the Vue instance and throws as en error.I've also tried the
errorCaptured
and thewarningCaptured
lifecycle hook and it doesn't seem to work either. The issue as of right now is that all errors that happen with the template will get outputted to the console.Let's consider this as an example:
Example above will work just fine as
vars.hello
is defined and it'll showworld
as expected.If we consider the following as an example, is where we will run into some issues:
vars.test
is not defined and it will show nothing, but the issue here is that the error/warning is outputted in the console. Is there any way to get the error be shown in the template itself or somehow in the code with a setup like this? From what I've researched, it does not seem possible.Beta Was this translation helpful? Give feedback.
All reactions