nextcloud / notes

✎ Distraction-free notes and writing
https://apps.nextcloud.com/apps/notes
GNU Affero General Public License v3.0
623 stars 133 forks source link

Fix "TypeError: t is undefined" #1264

Closed HolgerHees closed 7 months ago

HolgerHees commented 7 months ago

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

https://github.com/nextcloud/notes/issues/1259

HolgerHees commented 7 months ago

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

jancborchardt commented 7 months ago

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

juliusknorr commented 7 months ago

CI failures are unrelated, will check separately

mchiappinam commented 1 month ago

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 commented 1 month ago

@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.