Some commits are shown as ... in file list with js error: JavaScript error: Uncaught TypeError: Cannot read properties of undefined (reading 'replaceWith') #9077

Closed
opened 2025-11-02 08:28:34 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @Fogapod on GitHub (Jun 17, 2022).

Description

https://gitea.com/marktsai0316/linux/src/branch/master/scripts
https://gitea.com/marktsai0316/linux/src/branch/master/scripts/clang-tools
https://gitea.com/marktsai0316/linux/src/branch/master/scripts/atomic

Error from ui: JavaScript error: Uncaught TypeError: Cannot read properties of undefined (reading 'replaceWith') (https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873 @ 83:2368). Open browser console to see more details.
From console:

Uncaught TypeError: Cannot read properties of undefined (reading 'replaceWith')
    at HTMLTableRowElement.<anonymous> (index.js?v=5b550aecacf32806c61a3f6e9820c873:83:2368)
    at Function.each (index.js?v=5b550aecacf32806c61a3f6e9820c873:1:5483)
    at s.fn.init.each (index.js?v=5b550aecacf32806c61a3f6e9820c873:1:3942)
    at Object.success (index.js?v=5b550aecacf32806c61a3f6e9820c873:83:2229)
    at Ce (index.js?v=5b550aecacf32806c61a3f6e9820c873:1:32645)
    at Object.fireWith [as resolveWith] (index.js?v=5b550aecacf32806c61a3f6e9820c873:1:33444)
    at Xi (index.js?v=5b550aecacf32806c61a3f6e9820c873:4:6109)
    at XMLHttpRequest.<anonymous> (index.js?v=5b550aecacf32806c61a3f6e9820c873:4:8596)

When this happens, some files dont show commit message/date:
image

I am not sure how to reproduce this reliably yet. It just happens randomly with random files when going through folders
image

Error goes away after a few page refreshes. I noticed that it happens more frequently with small browser window

Screenshots

image

Gitea Version

1.17.0+dev-711-g1fef9a2d6

Can you reproduce the bug on the Gitea demo site?

Yes

Operating System

Artix Linux

Browser Version

Chromium based 100+

Originally created by @Fogapod on GitHub (Jun 17, 2022). ### Description https://gitea.com/marktsai0316/linux/src/branch/master/scripts https://gitea.com/marktsai0316/linux/src/branch/master/scripts/clang-tools https://gitea.com/marktsai0316/linux/src/branch/master/scripts/atomic Error from ui: `JavaScript error: Uncaught TypeError: Cannot read properties of undefined (reading 'replaceWith') (https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873 @ 83:2368). Open browser console to see more details.` From console: ```js Uncaught TypeError: Cannot read properties of undefined (reading 'replaceWith') at HTMLTableRowElement.<anonymous> (index.js?v=5b550aecacf32806c61a3f6e9820c873:83:2368) at Function.each (index.js?v=5b550aecacf32806c61a3f6e9820c873:1:5483) at s.fn.init.each (index.js?v=5b550aecacf32806c61a3f6e9820c873:1:3942) at Object.success (index.js?v=5b550aecacf32806c61a3f6e9820c873:83:2229) at Ce (index.js?v=5b550aecacf32806c61a3f6e9820c873:1:32645) at Object.fireWith [as resolveWith] (index.js?v=5b550aecacf32806c61a3f6e9820c873:1:33444) at Xi (index.js?v=5b550aecacf32806c61a3f6e9820c873:4:6109) at XMLHttpRequest.<anonymous> (index.js?v=5b550aecacf32806c61a3f6e9820c873:4:8596) ``` When this happens, some files dont show commit message/date: ![image](https://user-images.githubusercontent.com/22667809/174252881-dc97e117-f0df-4d92-8532-f186978bb418.png) I am not sure how to reproduce this reliably yet. It just happens randomly with random files when going through folders ![image](https://user-images.githubusercontent.com/22667809/174253615-de4ecd38-5528-4c2d-bfa7-24655bb0dd20.png) Error goes away after a few page refreshes. I noticed that it happens more frequently with small browser window ### Screenshots ![image](https://user-images.githubusercontent.com/22667809/174253037-06b7ad35-726a-44be-bb48-70990a149113.png) ### Gitea Version 1.17.0+dev-711-g1fef9a2d6 ### Can you reproduce the bug on the Gitea demo site? Yes ### Operating System Artix Linux ### Browser Version Chromium based 100+
GiteaMirror added the topic/uiissue/confirmedtype/bug labels 2025-11-02 08:28:34 -06:00
Author
Owner

@lunny commented on GitHub (Jun 17, 2022):

Cannot reproduce it in macOS 12.4 with Chrome 97.0

@lunny commented on GitHub (Jun 17, 2022): Cannot reproduce it in macOS 12.4 with Chrome 97.0
Author
Owner

@Fogapod commented on GitHub (Jun 17, 2022):

image

I just reproduced this with librewolf 101.0.1 (firefox based), so this doesn't seem browser related.

I suggest going through different folders because it seems like this error goes away for some time after you open these folders. Probably caching related somehow.

EDIT: just noticed that there is a different error now but the result is similar. Error text: JavaScript error: TypeError: e[r(...).attr(...)] is undefined (https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873 @ 83:2344). Open browser console to see more details.

Console:

Uncaught TypeError: e[r(...).attr(...)] is undefined
    mb https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:83
    each https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:1
    each https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:1
    mb https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:83
    Ce https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:1
    fireWith https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:1
    Xi https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:4
    u https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:4
[index.js:83:2344](https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873)
    mb https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:83
    each https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:1
    each https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:1
    mb https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:83
    Ce https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:1
    fireWith https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:1
    Xi https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:4
    u https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:4
@Fogapod commented on GitHub (Jun 17, 2022): <details> ![image](https://user-images.githubusercontent.com/22667809/174256328-7babe693-65cd-4bf0-a4c2-bb7326dab7e1.png) </details> I just reproduced this with librewolf 101.0.1 (firefox based), so this doesn't seem browser related. I suggest going through different folders because it seems like this error goes away for some time after you open these folders. Probably caching related somehow. EDIT: just noticed that there is a different error now but the result is similar. Error text: `JavaScript error: TypeError: e[r(...).attr(...)] is undefined (https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873 @ 83:2344). Open browser console to see more details.` <details> Console: ```js Uncaught TypeError: e[r(...).attr(...)] is undefined mb https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:83 each https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:1 each https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:1 mb https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:83 Ce https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:1 fireWith https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:1 Xi https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:4 u https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:4 [index.js:83:2344](https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873) mb https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:83 each https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:1 each https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:1 mb https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:83 Ce https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:1 fireWith https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:1 Xi https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:4 u https://gitea.com/assets/js/index.js?v=5b550aecacf32806c61a3f6e9820c873:4 ``` </details>
Author
Owner

@wxiaoguang commented on GitHub (Jun 17, 2022):

index.js: {r("table#repo-files-table .commit-list").replaceWith(l);return}e[r(l).attr("data-entryname")].replaceWith(l)})

Crashed here: a036507204/web_src/js/features/repo-commit.js (L48)

@wxiaoguang commented on GitHub (Jun 17, 2022): `index.js`: `{r("table#repo-files-table .commit-list").replaceWith(l);return}e[r(l).attr("data-entryname")].replaceWith(l)})` Crashed here: https://github.com/go-gitea/gitea/blob/a036507204fabd1d7cff3577692bc7d8e4ef7395/web_src/js/features/repo-commit.js#L48
Author
Owner

@wxiaoguang commented on GitHub (Jun 17, 2022):

A quick patch: #19996

I do not know how it happens at the moment, the logic seems complex here. 😂

@wxiaoguang commented on GitHub (Jun 17, 2022): A quick patch: #19996 * https://github.com/go-gitea/gitea/pull/19996 I do not know how it happens at the moment, the logic seems complex here. 😂
Author
Owner

@wxiaoguang commented on GitHub (Jun 17, 2022):

@Fogapod that's very strange that I still have difficult to reproduce the problem. So here is a quick patch.

Could you find more clues about how to trigger the error? It seems that the returned content is the key. Could you share the returned lastcommit response when error occurs? Thank you very much.

@wxiaoguang commented on GitHub (Jun 17, 2022): @Fogapod that's very strange that I still have difficult to reproduce the problem. So here is a quick patch. Could you find more clues about how to trigger the error? It seems that the returned content is the key. Could you share the returned `lastcommit` response when error occurs? Thank you very much.
Author
Owner

@Fogapod commented on GitHub (Jun 17, 2022):

What do you mean by lastcommit?
I have https://gitea.com/marktsai0316/linux/src/branch/master/drivers opened right now and more than half of files are shown as ....
These are all requests i have:
image

@Fogapod commented on GitHub (Jun 17, 2022): What do you mean by `lastcommit`? I have https://gitea.com/marktsai0316/linux/src/branch/master/drivers opened right now and more than half of files are shown as `...`. These are all requests i have: ![image](https://user-images.githubusercontent.com/22667809/174263525-da90ed26-8d89-4a29-af6b-7778987ec44a.png)
Author
Owner

@wxiaoguang commented on GitHub (Jun 17, 2022):

Hmm .... I think I have some clues about the problem .....

@wxiaoguang commented on GitHub (Jun 17, 2022): Hmm .... I think I have some clues about the problem .....
Author
Owner

@Fogapod commented on GitHub (Jun 17, 2022):

In case this is somehow useful: red box is properly displayed commit, blue is .... Css classes are different for them. I don't know what this might mean though:

image

@Fogapod commented on GitHub (Jun 17, 2022): In case this is somehow useful: red box is properly displayed commit, blue is `...`. Css classes are different for them. I don't know what this might mean though: <details> ![image](https://user-images.githubusercontent.com/22667809/174265188-f5c31207-3bc2-47a4-ae6d-4d279d48bc2c.png) </details>
Author
Owner

@wxiaoguang commented on GitHub (Jun 17, 2022):

OK, everything clear. Will update the PR soon.

The problem is that there are unrecognized tr rows in response, and the JS code didn't handle it correctly.

@wxiaoguang commented on GitHub (Jun 17, 2022): OK, everything clear. Will update the PR soon. The problem is that there are unrecognized `tr` rows in response, and the JS code didn't handle it correctly.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9077