8000 Fix "TypeError: t is undefined" by HolgerHees · Pull Request #1264 · nextcloud/notes · GitHub
[go: up one dir, main page]

Skip to content

Fix "TypeError: t is undefined"#1264

Merged
juliusknorr merged 1 commit intonextcloud:mainfrom
HolgerHees:main
Apr 24, 2024
Merged

Fix "TypeError: t is undefined"#1264
juliusknorr merged 1 commit intonextcloud:mainfrom
HolgerHees:main

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 requested a review from juliusknorr March 29, 2024 18:11
@HolgerHees HolgerHees added bug Something isn't working javascript Pull requests that update Javascript code labels Mar 29, 2024
@HolgerHees HolgerHees requested a review from korelstar March 30, 2024 15:48
@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
@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

0