memos icon indicating copy to clipboard operation
memos copied to clipboard

Mermaid Diagrams causing "syntax error in text"

Open blafusel opened this issue 1 year ago • 6 comments

Describe the bug

I am seeing a Syntax error in text. mermaid version 11.2.1 when trying to create a simple mermaid diagram.

Steps to reproduce

Create a simple mermaid diagram:

mermaid
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;

The version of Memos you're using.

v0.23.0

Screenshots or additional context

image

blafusel avatar Oct 26 '24 17:10 blafusel

Unable to replicate in the latest version. Note: your example is missing the ```s at the start and end. See https://www.usememos.com/docs/getting-started/content-syntax#rendering-mermaid-diagrams

e.g. memo text image

e.g. diagram image

RoccoSmit avatar Nov 02 '24 00:11 RoccoSmit

Strange. I am running v0.23.0 in a docker.

Here what I see:

Screenshot 2024-11-01 at 10 29 22 PM Screenshot 2024-11-01 at 10 29 32 PM Screenshot 2024-11-01 at 10 29 43 PM

blafusel avatar Nov 02 '24 05:11 blafusel

What browser/os are you using?

RoccoSmit avatar Nov 02 '24 05:11 RoccoSmit

I was able to replicate with 2 different instances of v.0.23.0. The newer (newer git commit) one working, the older (older git commit) one not working. Can you try pull the latest docker image with the latest tag.

RoccoSmit avatar Nov 02 '24 06:11 RoccoSmit

I am seeing the same problem with Edge, Safari, Chrome and Chromium.

I am using the latest version of Memos from here: https://registry.hub.docker.com/r/neosmemo/memos/

Should I use a different registry?

blafusel avatar Nov 02 '24 07:11 blafusel

I think something is happening during the build process. Local development works without any issues but when the website is run via docker the browser shows the following error when a mermaid note is added

image

RoccoSmit avatar Nov 02 '24 08:11 RoccoSmit

Fixed with https://github.com/usememos/memos/commit/57c00734e2a873e56d47b5f16589281c4433c2cf

The main reason for this issue is that files generated with a leading underscore(_) during the frontend build are ignored by Go's embed functionality by default. This causes a 404 error, redirecting to index.html.

boojack avatar Nov 05 '24 13:11 boojack

Image

Seeing this in 11.4.1

trancethehuman avatar Feb 28 '25 04:02 trancethehuman