[1.21.0] Mermaid on Wiki no longer working #12065

Closed
opened 2025-11-02 09:56:36 -06:00 by GiteaMirror · 15 comments
Owner

Originally created by @scara on GitHub (Nov 22, 2023).

Description

Hello Everyone,
just updated from 1.20.5 to 1.21.0 and the mermaid git diagram on a Wiki page breaks with the following error Qa(...).catch is not a function and nothing in JS console, just the plain source text of the diagram below the error.

Same error if starting from a fresh 1.21.0 installation.

The error cannot be reproduced on the Gitea demo site, 1.22.0+dev-350-g2d9b91aa2.

https://blog.gitea.com/release-of-1.21.0/ doesn't provide any hint/advice about Mermaid diagrams.

Thanks in advance,
Matteo

Gitea Version

1.21.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Docker Rootless Image

How are you running Gitea?

Using the Docker rootless image, docker.io/gitea/gitea:1.21.0-rootless, by means of a quite standard compose.

Database

MySQL/MariaDB

Originally created by @scara on GitHub (Nov 22, 2023). ### Description Hello Everyone, just updated from `1.20.5` to `1.21.0` and the `mermaid` git diagram on a Wiki page breaks with the following error `Qa(...).catch is not a function` and nothing in JS console, just the plain source text of the diagram below the error. Same error if starting from a fresh `1.21.0` installation. The error cannot be reproduced on the _Gitea demo site_, `1.22.0+dev-350-g2d9b91aa2`. https://blog.gitea.com/release-of-1.21.0/ doesn't provide any hint/advice about Mermaid diagrams. Thanks in advance, Matteo ### Gitea Version 1.21.0 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System Docker Rootless Image ### How are you running Gitea? Using the _Docker rootless image_, `docker.io/gitea/gitea:1.21.0-rootless`, by means of a quite standard compose. ### Database MySQL/MariaDB
GiteaMirror added the type/bugissue/needs-feedback labels 2025-11-02 09:56:36 -06:00
Author
Owner

@silverwind commented on GitHub (Nov 22, 2023):

I can not reproduce this on my 1.21 instance. What browser are you using and did you try others? Got a full error stack trace and ideally a screenshot of devtools where the error occured in the minified JS?

@silverwind commented on GitHub (Nov 22, 2023): I can not reproduce this on my 1.21 instance. What browser are you using and did you try others? Got a full error stack trace and ideally a screenshot of devtools where the error occured in the minified JS?
Author
Owner

@wxiaoguang commented on GitHub (Nov 22, 2023):

Unable to reproduce either. I have started a fresh instance by image: gitea/gitea:1.21.0-rootless:

image

@wxiaoguang commented on GitHub (Nov 22, 2023): Unable to reproduce either. I have started a fresh instance by `image: gitea/gitea:1.21.0-rootless`: ![image](https://github.com/go-gitea/gitea/assets/2114189/0bb02fb1-f1ab-4581-9b79-3038ae6324d1)
Author
Owner

@scara commented on GitHub (Nov 22, 2023):

Hi @silverwind and @wxiaoguang,
I'm using both Chrome 119.0.6045.160 (Official Build) (64-bit) and Edge 119.0.2151.72 (Official build) (64-bit), on Windows 11, and the issue is there on both of them.

Give this diagram a try:

---
title: "Mermaid Git Diagram on v1.21.0"
---
%%{
  init: {
    'theme': 'base'
  }
}%%
gitGraph
    commit
    commit
    branch develop
    checkout develop
    commit
    commit
    checkout main
    merge develop
    commit
    commit

Maybe it is a Docker image related issue.

DevTools doesn't give any hint since there's no JS error in the console (neither 404s): AFAIK it's a managed exception.

TIA,
Matteo

@scara commented on GitHub (Nov 22, 2023): Hi @silverwind and @wxiaoguang, I'm using both _Chrome_ `119.0.6045.160 (Official Build) (64-bit)` and _Edge_ `119.0.2151.72 (Official build) (64-bit)`, on _Windows 11_, and the issue is there on both of them. Give this diagram a try: ``` --- title: "Mermaid Git Diagram on v1.21.0" --- %%{ init: { 'theme': 'base' } }%% gitGraph commit commit branch develop checkout develop commit commit checkout main merge develop commit commit ``` Maybe it is a _Docker_ image related issue. _DevTools_ doesn't give any hint since there's no JS error in the console (neither 404s): AFAIK it's a managed exception. TIA, Matteo
Author
Owner

@wxiaoguang commented on GitHub (Nov 22, 2023):

OK, reproduced by your sample.

It's really strange. share my findings:

  1. It could be reproduced by the sample above (both Gitea docker root/rootless images).
  2. There is no console log, because the displayError in markup/common.js doesn't output the details.
  3. I can't reproduce it on 1.21 branch or main branch (strange)
@wxiaoguang commented on GitHub (Nov 22, 2023): OK, reproduced by your sample. It's really strange. share my findings: 1. It could be reproduced by the sample above (both Gitea docker root/rootless images). 2. There is no console log, because the `displayError` in `markup/common.js` doesn't output the details. 3. I can't reproduce it on 1.21 branch or main branch (strange)
Author
Owner

@silverwind commented on GitHub (Nov 22, 2023):

I can reproduce, not just on wiki with this mermaid source:

gitGraph
    commit
    commit

Likely a bug in mermaid itself and we should upgrade the dependency.

@silverwind commented on GitHub (Nov 22, 2023): I can reproduce, not just on wiki with this mermaid source: ``` gitGraph commit commit ``` Likely a bug in mermaid itself and we should upgrade the dependency.
Author
Owner

@silverwind commented on GitHub (Nov 22, 2023):

I guess we need to upgrade mermaid in v1.21 branch. v1.21 uses mermaid v10.5.0, while main branch has v10.6.1.

@silverwind commented on GitHub (Nov 22, 2023): I guess we need to upgrade mermaid in v1.21 branch. v1.21 uses mermaid v10.5.0, while main branch has v10.6.1.
Author
Owner

@wxiaoguang commented on GitHub (Nov 22, 2023):

I guess we need to upgrade mermaid in v1.21 branch. v1.21 uses mermaid v10.5.0, while main branch has v10.6.1.

Could you reproduce on 1.21 branch (which uses mermaid 10.5.0)? I can't on my side ..... I can only reproduce it by the docker images.

@wxiaoguang commented on GitHub (Nov 22, 2023): > I guess we need to upgrade mermaid in v1.21 branch. v1.21 uses mermaid v10.5.0, while main branch has v10.6.1. Could you reproduce on 1.21 branch (which uses mermaid 10.5.0)? I can't on my side ..... I can only reproduce it by the docker images.
Author
Owner

@silverwind commented on GitHub (Nov 22, 2023):

It reproduces with my from-source compiled 1.21.0+8-gf8c5f202b non-docker instance, have not tried locally yet.

@silverwind commented on GitHub (Nov 22, 2023): It reproduces with my from-source compiled 1.21.0+8-gf8c5f202b non-docker instance, have not tried locally yet.
Author
Owner

@scara commented on GitHub (Nov 22, 2023):

Thanks for your repros!
Guessing that gitea 1.20.5 is working due to mermaid v10.2.3.

I'm actually new to gitea - great software! - so thanks @wxiaoguang even for your hint: 37ed92d6fd/web_src/js/markup/mermaid.js (L71)

HTH,
Matteo

@scara commented on GitHub (Nov 22, 2023): Thanks for your repros! Guessing that `gitea` `1.20.5` is working due to `mermaid` [`v10.2.3`](https://github.com/go-gitea/gitea/blob/v1.20.5/package.json#L35). I'm actually new to `gitea` - great software! - so thanks @wxiaoguang even for your hint: https://github.com/go-gitea/gitea/blob/37ed92d6fdb989fd5e56621f33b3e26369933ec2/web_src/js/markup/mermaid.js#L71 HTH, Matteo
Author
Owner

@scara commented on GitHub (Dec 21, 2023):

Hello Everyone,
any ETA for a resolution on v1.21?

Will this issue be just "automagically" resolved using v1.22 when it will be released?

TIA,
Matteo

@scara commented on GitHub (Dec 21, 2023): Hello Everyone, any ETA for a resolution on `v1.21`? Will this issue be just "automagically" resolved using `v1.22` when it will be released? TIA, Matteo
Author
Owner

@wxiaoguang commented on GitHub (Dec 21, 2023):

I can't reproduce it on my side, so I don't know whether "updating the mermaid version" is the right approach.

Anyway, I can propose a PR without any test/guarantee ( Update mermaid for 1.21 #28571 )

Feel free to build your own binary to test whether it really works.

@wxiaoguang commented on GitHub (Dec 21, 2023): I can't reproduce it on my side, so I don't know whether "updating the mermaid version" is the right approach. Anyway, I can propose a PR without any test/guarantee ( Update mermaid for 1.21 #28571 ) Feel free to build your own binary to test whether it really works.
Author
Owner

@scara commented on GitHub (Dec 21, 2023):

Hi @wxiaoguang,

I can't reproduce it on my side, so I don't know whether "updating the mermaid version" is the right approach.

OK
I'll give the latest 1.21 a try to check if it was just a build issue for the 1.21.0 docker tag.

Matteo

@scara commented on GitHub (Dec 21, 2023): Hi @wxiaoguang, > I can't reproduce it on my side, so I don't know whether "updating the mermaid version" is the right approach. OK I'll give the latest `1.21` a try to check if it was just a build issue for the `1.21.0` docker tag. Matteo
Author
Owner

@wxiaoguang commented on GitHub (Dec 21, 2023):

The 1.21 nightly builds are ready.

@wxiaoguang commented on GitHub (Dec 21, 2023): The 1.21 nightly builds are ready.
Author
Owner

@wxiaoguang commented on GitHub (Dec 28, 2023):

Feel free to reopen if there is still any problem.

@wxiaoguang commented on GitHub (Dec 28, 2023): Feel free to reopen if there is still any problem.
Author
Owner

@scara commented on GitHub (Dec 28, 2023):

Hi @wxiaoguang,
docker.io/gitea/gitea:1.21.3-rootless is still affected by the issue (Qa(...).catch is not a function) while nightly (docker.io/gitea/gitea:1.21-nightly-rootless), 1.21.3+14-ga5c7ac998, is running the chart fine.

Thanks for 1fc6bc1be2!

Matteo

@scara commented on GitHub (Dec 28, 2023): Hi @wxiaoguang, `docker.io/gitea/gitea:1.21.3-rootless` is **still** affected by the issue (`Qa(...).catch is not a function`) while _nightly_ (`docker.io/gitea/gitea:1.21-nightly-rootless`), `1.21.3+14-ga5c7ac998`, is running the chart fine. Thanks for https://github.com/go-gitea/gitea/commit/1fc6bc1be20469a9ff481d55a202b1d04b3b02e1! Matteo
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12065