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

Fix "TypeError: t is undefined" #1264

Merged
merged 1 commit into from
Apr 24, 2024
Merged

Conversation

HolgerHees
Copy link
Contributor

@HolgerHees HolgerHees commented Mar 29, 2024

vue "created" does not guaranteed that all refs are filled. Sometime $refs.editor is undefined. Also an extra tick like in line 84 does not help.

created() is great for calling APIs, while mounted() is great for doing anything after the DOM elements have completely loaded.

using "mounted" instead of "created" fixes this issues

the bug itself is documented here

#1259

vue created does not guaranteed that all refs filled. Sometime $refs.editor is undefined. Also an extra tick like in line 84 does not help.

using mounted instead of created fixes this issues

Signed-off-by: Holger Hees <holger.hees@gmail.com>
@HolgerHees HolgerHees added bug Something isn't working javascript Pull requests that update Javascript code labels Mar 29, 2024
@HolgerHees
Copy link
Contributor Author

@juliushaertl is there anything missing or something I can do?

@jancborchardt
Copy link
Member

@korelstar could you verify this? :) Also @mejo- @max-nextcloud maybe one of you can check.

Copy link
Member

@juliusknorr juliusknorr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, makes sense 👍

@juliusknorr
Copy link
Member

CI failures are unrelated, will check separately

@juliusknorr juliusknorr merged commit 2ee75a5 into nextcloud:main Apr 24, 2024
6 of 9 checks passed
@mchiappinam
Copy link

Is that issue with Notes + Nextcloud back on version 30? I was on version 28 today, upgraded to 29 and at that point the notes app was working still. But after upgrading to v30, I'm seeing this:
NoteRich.vue:89 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'createEditor')
image
Note: I don't think the first error is related as it says bootstrap.

@max-nextcloud
Copy link

@mchiappinam That's most likely a different issue. Your exception says createEditor is called on undefined. In this case t was undefined but createEditor is not called on t - so the two exceptions are not related. Plus this fix has been merged a while back. So it's probably included in Nextcloud 30 already.

Please open a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants