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

TypeError: n[r] is undefined #24

Closed
noelma opened this issue Nov 16, 2020 · 14 comments
Closed

TypeError: n[r] is undefined #24

noelma opened this issue Nov 16, 2020 · 14 comments
Assignees

Comments

@noelma
Copy link

noelma commented Nov 16, 2020

Description

J'ai essayé de mettre à jour mon forum à la version flarum 0.1.0-beta.14.1 en partant de la version 0.1.0-beta.13
Tout s'est bien passé hors l'utilisation du module de traduction pour la langue française. J'ai pu voir qu'il y avait déjà un post sur le forum officiel de Flarum concernant ce problème :

https://discuss.flarum.org/d/615-french-language-pack/241

J'ai pu faire le test et le problème persiste. Je n'ai pas trouvé comment vérifier ma version de Moment.js

Steps to reproduce

  1. Installer qiaeru/lang-french,
  2. Se rendre sur la page d'accueil ou sur une liste de discussion,
  3. Afficher d'anciens posts de 2019.

Expected behaviour: De voir les poste dans les listes de discutions

Actual behaviour: Chargement infinie des liste de discussion avec comme erreur console TypeError: n[r] is undefined

Configuration

Flarum version: 0.1.0-beta.14.1

French language pack version: 1.8.1

Installed extensions:

    "require": {
        "flarum/approval": "^0.1.0",
        "flarum/bbcode": "^0.1.0",
        "flarum/core": "^0.1.0",
        "flarum/emoji": "^0.1.0",
        "flarum/flags": "^0.1.0",
        "flarum/lang-english": "^0.1.0",
        "flarum/likes": "^0.1.0",
        "flarum/lock": "^0.1.0",
        "flarum/markdown": "^0.1.0",
        "flarum/mentions": "^0.1.0",
        "flarum/pusher": "^0.1.0",
        "flarum/statistics": "^0.1.0",
        "flarum/sticky": "^0.1.0",
        "flarum/subscriptions": "^0.1.0",
        "flarum/suspend": "^0.1.0",
        "flarum/tags": "^0.1.0",
        "fof/analytics": "^0.10.0",
        "fof/best-answer": "^0.2.0",
        "fof/formatting": "^0.2.0",
        "fof/forum-statistics-widget": "^0.3.0",
        "fof/links": "^0.4.1",
        "fof/oauth": "^0.1.0",
        "fof/polls": "^0.1.3",
        "fof/reactions": "^0.4.2",
        "fof/spamblock": "^0.3.0",
        "fof/upload": "^0.11.0",
        "fof/user-bio": "^0.3.1",
        "michaelbelgium/flarum-discussion-views": "^5.0",
        "qiaeru/lang-french": "^1.8"
    }

The operating system and the web browser you are running on may also help with reproducing the issue, so feel free to tell us :
Testé sur Firefox 82

@HLFH
Copy link

HLFH commented Nov 18, 2020

@qiaeru Hi. Any ideas how to fix it? Thanks

@qiaeru
Copy link
Collaborator

qiaeru commented Nov 18, 2020

Merci beaucoup, je vais regarder ça de plus près car il n'y a pas de raison visible que le problème persiste.

Je suis indisponible aujourd'hui mais je m'y attelle dès que j'ai un moment de libre. 👍

Merci de la remontée !

@qiaeru
Copy link
Collaborator

qiaeru commented Nov 19, 2020

Je viens de déployer la version 1.8.2 de la traduction, qui contient quelques clés de langue manquantes.

Pouvez-vous me faire un retour si cela règle le problème cité plus haut, n'étant actuellement pas en capacité de tester par moi-même ? En vous remerciant !

I just released version 1.8.2 of the language pack, which contains some missing language keys.

Can you give me feedback if this fixes the above issue (I'm not able to test it by myself at the moment)? Thanks!

@HLFH
Copy link

HLFH commented Nov 19, 2020

Hi @qiaeru

I updated to 1.8.2.

At the forum homepage, I have the following error:

TypeError: Cannot read property 'replace' of undefined
    at localizedFormat.js:1
    at String.replace (<anonymous>)
    at d.i.format (localizedFormat.js:1)
    at i (humanTime.ts:26)
    at e.n.view (DiscussionListItem.js:106)
    at Function.a (render.js:30)
    at render.js:155
    at render.js:160
    at l (render.js:66)
    at u (render.js:50)
a @ mount-redraw.js:15
(anonymous) @ mount-redraw.js:25
requestAnimationFrame (async)
c @ mount-redraw.js:23
e.clear @ DiscussionListState.js:64
e.refresh @ DiscussionListState.js:88
e.refreshParams @ DiscussionListState.js:75
n.oninit @ IndexPage.js:40
a @ render.js:30
M @ render.js:917
(anonymous) @ render.js:153
(anonymous) @ render.js:160
l @ render.js:66
u @ render.js:50
(anonymous) @ render.js:103
l @ render.js:62
(anonymous) @ render.js:487
f @ render.js:419
h @ render.js:302
(anonymous) @ render.js:964
a @ mount-redraw.js:14
v @ router.js:114
Promise.then (async)
t @ router.js:126
S @ router.js:95
a @ render.js:30
(anonymous) @ render.js:971
mount @ mount-redraw.js:45
y @ router.js:160
e.mount @ Application.js:198
n.mount @ ForumApplication.js:121
e.boot @ Application.js:176
(anonymous) @ (index):203

When I click on a post from the forum homepage, I have the following error:

TypeError: Cannot read property 'replace' of undefined
    at localizedFormat.js:1
    at String.replace (<anonymous>)
    at d.i.format (localizedFormat.js:1)
    at i (humanTime.ts:26)
    at e.n.view (DiscussionListItem.js:106)
    at Function.a (render.js:30)
    at render.js:155
    at render.js:160
    at l (render.js:66)
    at u (render.js:50)
a @ mount-redraw.js:15
(anonymous) @ mount-redraw.js:25
requestAnimationFrame (async)
c @ mount-redraw.js:23
e.clear @ DiscussionListState.js:64
e.refresh @ DiscussionListState.js:88
e.refreshParams @ DiscussionListState.js:75
n.oninit @ IndexPage.js:40
a @ render.js:30
M @ render.js:917
(anonymous) @ render.js:153
(anonymous) @ render.js:160
l @ render.js:66
u @ render.js:50
(anonymous) @ render.js:103
l @ render.js:62
(anonymous) @ render.js:487
f @ render.js:419
h @ render.js:302
(anonymous) @ render.js:964
a @ mount-redraw.js:14
v @ router.js:114
Promise.then (async)
t @ router.js:126
S @ router.js:95
a @ render.js:30
(anonymous) @ render.js:971
mount @ mount-redraw.js:45
y @ router.js:160
e.mount @ Application.js:198
n.mount @ ForumApplication.js:121
e.boot @ Application.js:176
(anonymous) @ (index):203
mount-redraw.js:15 TypeError: Cannot read property 'onbeforeupdate' of undefined
    at render.js:929
    at f (render.js:407)
    at h (render.js:302)
    at render.js:477
    at f (render.js:416)
    at h (render.js:315)
    at render.js:477
    at f (render.js:416)
    at h (render.js:302)
    at render.js:477
a @ mount-redraw.js:15
(anonymous) @ mount-redraw.js:25
requestAnimationFrame (async)
c @ mount-redraw.js:23
n.load @ DiscussionPage.js:113
n.oninit @ DiscussionPage.js:35
a @ render.js:30
M @ render.js:917
(anonymous) @ render.js:153
(anonymous) @ render.js:160
l @ render.js:66
u @ render.js:50
h @ render.js:374
(anonymous) @ render.js:444
f @ render.js:415
(anonymous) @ render.js:488
f @ render.js:419
h @ render.js:302
(anonymous) @ render.js:964
a @ mount-redraw.js:14
(anonymous) @ mount-redraw.js:25
requestAnimationFrame (async)
c @ mount-redraw.js:23
v @ router.js:111
Promise.then (async)
t @ router.js:126
S @ router.js:95
(anonymous) @ setImmediate.js:40
f @ setImmediate.js:69
a @ setImmediate.js:109
postMessage (async)
i @ setImmediate.js:120
p.setImmediate @ setImmediate.js:27
d @ router.js:143
p @ router.js:20
y.set @ router.js:182
s.attrs.onclick @ router.js:250
_.handleEvent @ render.js:888
mount-redraw.js:15 TypeError: Cannot read property 'onbeforeupdate' of undefined
    at render.js:929
    at f (render.js:407)
    at h (render.js:302)
    at render.js:477
    at f (render.js:416)
    at h (render.js:315)
    at render.js:477
    at f (render.js:416)
    at h (render.js:302)
    at render.js:477

I don't have these errors neither in English nor in German.
I am also using the extension lang-french-extended which should be compatible.

@qiaeru
Copy link
Collaborator

qiaeru commented Nov 19, 2020

Thanks @HLFH! Can you try to disable all the other extensions, like lang-french-extended then give me a feedback if the issue still persists?

@HLFH
Copy link

HLFH commented Nov 19, 2020

@qiaeru Same issue with lang-french-extended disabled.

@qiaeru
Copy link
Collaborator

qiaeru commented Nov 19, 2020

@qiaeru Same issue with lang-french-extended disabled.

Mmmh thanks. I will investigate further but I don't understand what's wrong. 🤷‍♂️

@HLFH
Copy link

HLFH commented Nov 19, 2020

@qiaeru I was thinking there was a similar issue on flarum-de package.
Please look at commits from releases 0.13.0 and 0.13.1.
https://github.com/Kakifrucht/flarum-de/releases

And especially this commit > flarum-lang/german@262f7ef

I had a similar issue with flarum-de, but with last release, it is fixed.

@qiaeru
Copy link
Collaborator

qiaeru commented Nov 19, 2020

Thank you so much! I wasn't aware that Flarum is now using Day.js and not Moment.js!

Communication between the Flarum team and the translators needs to be improved as we are not currently aware of the changes that affect us.

I will try to deploy a new version today with the fix, but I think I won't have the time today and it will have to wait until tomorrow.

Anyway, a big thank you to you @HLFH! 😉

@qiaeru
Copy link
Collaborator

qiaeru commented Nov 19, 2020

New version released. Can you try to update and to test if everything's okay now? 😀

@clarkwinkelmann
Copy link

Thank you so much! I wasn't aware that Flarum is now using Day.js and not Moment.js!

Unfortunately we don't publish a separate guide for language packs, but the Day.js change was presented in the beta 14 update guide for extensions https://docs.flarum.org/extend/update-b14.html#moment-dayjs

@HLFH
Copy link

HLFH commented Nov 19, 2020

New version released. Can you try to update and to test if everything's okay now? 😀

This works amazingly thanks to an amazing @qiaeru.
You can close the ticket.
Thank you, I appreciate your talent. Yes the PR (flarum/framework#2219) has been the culprit.

This is clearly something that should have been more communicated in this thread.

@noelma
Copy link
Author

noelma commented Nov 19, 2020

Je viens de tester en local la version 1.8.3 du plugin et je note que l'erreur a été corrigée.

J'ai également déployé le correctif sur mon serveur distant sans problème.

Merci encore pour votre réactivité et pour la communauté francophone 👍

Dommage qu'il s'agisse d'un problème de communication entre développeurs.

@qiaeru
Copy link
Collaborator

qiaeru commented Nov 19, 2020

Thank you so much! I wasn't aware that Flarum is now using Day.js and not Moment.js!

Unfortunately we don't publish a separate guide for language packs, but the Day.js change was presented in the beta 14 update guide for extensions https://docs.flarum.org/extend/update-b14.html#moment-dayjs

I understand, but just remember that translators are not developers. Documentation like this is often hard to understand to translators, and many open source projects communicate more easily with translators to solve this issue. All you have to do is display the list of changes with each new version (a diff thing), and notify when there are breaking changes.

Since we rely only on the flarum/lang-english GitHub repository, and it doesn't include a config.js file, it was impossible for us to see this change.

I'm not angry at all, I'm just pointing out that we need to improve communication, because translations are also an important part of the success of a forum software. ♥️

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

No branches or pull requests

4 participants