Open the browser console. Vue's warnings and errors usually name the component involved. The most common Vue errors are the same as plain JavaScript: a template or computed property reading data that isn't loaded yet, or a name used in a template that isn't defined in the component. To catch errors you don't see yourself, Vue lets you set a global error handler (app.config.errorHandler) and send errors to a logging service.
What's the problem
Part of your Vue app doesn't render or update, the page is blank, or the console shows [Vue warn] messages or red errors.
Why it happens
- Reading data before it loads, for example
user.namebeforeuseris fetched. - A property used in a template that isn't defined in the component.
- Wrong prop types or missing required props.
- Changing props directly inside a child component.
- A dependency or Vue version upgrade that changed behaviour.
How to fix it
- Read the console message and the component it names.
- Guard data in templates with
v-ifuntil it has loaded, or use optional chaining. - Check every name used in the template is defined in the component.
- Fix prop warnings by passing the right types.
- Add a global error handler with
app.config.errorHandlerto log errors your visitors hit. - Check recent changes to the component and dependencies.
What Preventionlabs checks
One click runs the full report on your domain. For this problem it shows whether your site loads, how fast, and where its redirects go; script libraries on your homepage with published security holes; every outside service your homepage loads scripts and files from. With Cloudflare connected, it also shows recent deploys and account changes, with their times. It doesn't run your pages in a browser, so open the browser console on the failing page to see the error itself.
Run your free reportYour first report is free, no card needed. Then A$50 a month, up to 10 domains. Read-only: it never changes anything.
Sources
- Vue.js: Application APIofficial docs
Assign a global handler for uncaught errors propagating from within the application.
- MDN Web Docs: TypeError: "x" is (not) "y"reference
Oftentimes, unexpected undefined or null values.
Preventionlabs is independent and not affiliated with Vue. Product names are used only to describe the problem.
← All of JavaScript