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

Cannot read properties of null (reading 'emitsOptions') #8146

Open
shiwanjun1995 opened this issue Apr 24, 2023 · 4 comments · May be fixed by #9783
Open

Cannot read properties of null (reading 'emitsOptions') #8146

shiwanjun1995 opened this issue Apr 24, 2023 · 4 comments · May be fixed by #9783

Comments

@shiwanjun1995
Copy link

Vue version

3.2.25

Link to minimal reproduction

https://play.vuejs.org/#eNp9VttOG0cYfpWJb2wiwEml3lgG9aCoVaWqVUHqRd2LjT0226x33d0xCUKWnBDOJgbihHOwoxBIQ0zI0QccHiY7s/ZVXqH/zOwuNgnhAnlm/uP3ff/sTAa+z2QGx7M4EAlErbipZgiyMMlmhmO6ms4YJkGTyMRJlENJ00ijIJgG/aNrtzKKnnBPBsNyyaOBSUyPG7pFUNpKoSEeIhT8GWuagf40TC1xKdgX06NhmRFywYLgdEZTCIYVQtGxq8OTk8I5l4uGYSV2VT2TJWh8IG0ksDYUC8B5LCCPEuo4imuKZcE2MVIpDbsn8BeVlfE8JEa+FsXtwV1ATPgVDfulBfoDZ01yyC4NDCB6/ICe5FnpXfvt+/bpLKtVnOZdu/kODQxw796+lIHrWUIMHZGJDOal4lskFkDfxTU1fgPWhi4T+MX7/lCwmgQL3HsOFhZsDMv8AClfuK5nhX8eC2uWt+2FkI18LUQ07NUvOIMNDkB0FGtYCMItkShmCvO2IsToWg5LRMDLdzhn4CYdNRXdUolq6D+ZRjaDdCUtsDpHK5StGX5SHxdoALb9Bs4Fc/vwKujlVwjx4jFQ4kQdx/3I0H81sjrBiX5EjD9w0jo3HjE9fPky5Lnc3cowYutHdi1v1/6jM9NOqypV8umk0D7dYHeLdOW1s5On1Sm6fWA3m3xn7rmzeVea2bUXnakWLR7Zzb324+d269QpHYAvWyt3tvPs9QGdKXzM3xFJeQxhSF/OtE+36PQe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SAKU3ZpA7dYhzAyftI0qDLg84hXVSv68cKyWV+i9Xbq/KA0gPTz9PLAn3ab73Rrgsznk5g31ENFFkPcgAstQHxoalpLpsR50ow2hS1/aFz2DAEIu/fDR/oIVpMx1ycKcGMFkVFR7LrM54anWFZqklGvNiGf5z8F/s5j7S+JDYgAGiQEZuBd8/UKXXKc+RMZM+Nrp+Ca6ZppgHNThRQMiTEzwF7KXBQQ+qBmpkOfmTk1PGxJaKKNLYzkUV0h8DIUwD97XXbgfUpzIfSFXMqqmsZEloW4M+tHVK1eEFYAkcPLfQKFecHyXEEe095UfyP0PMqMByA==

Steps to reproduce

When i comment out line 12, open line 13, the error appears!

What is expected?

No error.

What is actually happening?

Has error.

System Info

No response

Any additional comments?

Please fixed it.

@shiwanjun1995
Copy link
Author

@https://github.com/posva

@yyx990803
Copy link
Member

@https://github.com/posva

Do NOT at people like this. If someone has the bandwidth to handle this issue, they will.

@soletan
Copy link

soletan commented May 22, 2023

Just came across the same error message in a bunch of basically different use cases. AFAICT, this particular issue is just a follow up to some other issue which is causing Vue to throw in a wrong moment such as the set up of a component in my case.

I was observing it several times within the last two hours due to some race conditions when a component's template is trying to de-reference something that hasn't been set, yet.

When looking into your code, there is a Vue warning regarding the fact that the Teleport target is null. As soon as you prevent the Teleport from being applied prior to having some actual target, the error is gone as you've mentioned in your post, too.

So, preferring Vue to not throw might be eligible, though it might just slow it down for no permanent benefit. And there is a warning you shouldn't ignore. It's there for a reason, I guess.

@BillyBobFry
Copy link

BillyBobFry commented Mar 5, 2024

Similar to the comment above, I saw this error because of a teleport with null content. This was what the code was like:

  <Teleport>
    to="someLocator"
    :disabled="!someCondition"
  >
    <div v-if="someCondition">someContent</div>
  </Teleport>

I resolved the issue by updating it to

  <Teleport>
    to="someLocator"
    v-if="someCondition"
  >
    <div>someContent</div>
  </Teleport>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants