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

[Vue warn]: Property ("_isVue" | "constructor") was accessed during render but is not defined on instance. #996

Closed
ordago opened this issue Jan 9, 2023 · 7 comments · Fixed by #1000
Assignees
Labels
vue @honeybadger-io/vue

Comments

@ordago
Copy link

ordago commented Jan 9, 2023

I'm using honeybadger with Laravel, Inertia and Vue3.

Honeybadger seems to be accessing a Vue2 deprecated property.

I found the equivalent issue in Sentry while searching the error
getsentry/sentry-javascript#4170

And the PR that fixed it:
https://github.com/getsentry/sentry-javascript/pull/4461/files

What are the steps to reproduce this issue?

  1. The error happened when calling includes on null in a computed property.

What happens?

Some errors but not others make it so honeybadger throws its own error.
[Vue warn]: Property "_isVue" was accessed during render but is not defined on instance.

What were you expecting to happen?

Any logs, error output, etc?

Following the stacktrace in the browser points to this line:
Function.prototype.apply.call(original, _window.console, arguments);

Any other comments?

Here are the places where it's used:

if (vm._isVue && vm.$parent) {

What versions are you using?

Operating System: Windows 10
Package Name: @honeybadger-io/vue
Package Version: 4.8.2
Browser Version: Chrome

@subzero10
Copy link
Member

Hello @ordago,

Thank you for reporting this with all the detailed information. We'll work on it soon.

@subzero10 subzero10 added the vue @honeybadger-io/vue label Jan 10, 2023
@subzero10 subzero10 self-assigned this Jan 13, 2023
subzero10 added a commit that referenced this issue Jan 13, 2023
subzero10 added a commit that referenced this issue Jan 14, 2023
@subzero10
Copy link
Member

Hey @ordago, we just published @honeybadger-io/vue@4.9.1 that should fix this!

@ordago
Copy link
Author

ordago commented Jan 14, 2023

Hi @subzero10!, I've updated to the latest version and now instead of _isVue it says constructor.

[Vue warn]: Property "constructor" was accessed during render but is not defined on instance.

Stacktrace points to the same line:

Function.prototype.apply.call(original, _window.console, arguments);

constructor seems to be used near where the _isVue was:

export const generateComponentTrace = vm => {
if (vm && (vm.__isVue || vm._isVue) && vm.$parent) {
const tree = []
let currentRecursiveSequence = 0
while (vm) {
if (tree.length > 0) {
const last = tree[tree.length - 1]
if (last.constructor === vm.constructor) {

The warning appears several times on the console. All pointing to the same line.

image

If I edit to make it check for existence, it throws it only once.

if ((last?.constructor && vm?.constructor) && last.constructor === vm.constructor) {

I've tried to make a minimal reproduction, but I haven't managed to make it throw the same error.

@subzero10
Copy link
Member

Hey @ordago, thanks for trying this out so promptly!

To be honest, I got the constructor warning my self as well, but I wasn't sure if it was related to the example project I was working on or if indeed a more general issue.
This line of code seems to be in the sentry package as well, so I'm wondering if this warning appears on their package as well 🤔 .

Thank you for the suggested improvement, I will see if I can make that go away entirely.

@subzero10 subzero10 reopened this Jan 17, 2023
@subzero10 subzero10 changed the title [Vue warn]: Property "_isVue" was accessed during render but is not defined on instance. [Vue warn]: Property ("_isVue" | "constructor") was accessed during render but is not defined on instance. Jan 17, 2023
@subzero10
Copy link
Member

Hey @ordago, I just published v4.9.3.

It seems that we get this warning from Vue 3's special Proxy wrappers and if we check any property that does not exist on the vm it raises the warning. I didn't find a reliable way to check for recursive components so I decided to disable this block of code for Vue 3. I think it's fine without it, as it doesn't appear to be a very common scenario.

@ordago
Copy link
Author

ordago commented Jan 20, 2023

Hi @subzero10, I triggered the original error with the new version and now the console only shows my error. Thanks!

@subzero10
Copy link
Member

@ordago Awesome! Thank you for using Honeybadger!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vue @honeybadger-io/vue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants