Closed zkulbeda closed 1 year ago
This is the most common problem we keep running into. node_module
mapping to successfully call a CLI for Mermaid. Happy to review PR's related to a fix. It seems all that have been merged have fixed for one case and failed for the next. In the meantime, to generate in a format that will skip the CLI failure you could generate to markdown
generator erd {
provider = "prisma-erd-generator"
output = "./dist/erd.md"
}
I just tried it out and it generated successfully which tells me its not a formatting issue for the CLI, just a path issue
It really worked! Thank you.
No problem! Glad that will work for you. I want to say one of the best solutions to this problem is to add a variable to the node_module path so we can set it case by case. It will cause some breaking changes for many though. Leaving open to track that
Hi @keonik , such a great generator, thanks and congrats.
Just for letting you know, running on a WSL2 ubuntu 22 distro, with the --data-proxy flag, the generator fails.. also added the output as you suggested here previously. The ouput is:
workaround to it by creating an empty erd.md
file in the output path.
Now my question is, and sorry for this but I ignore the answer, how can I "visualize" this .md file?? For example, with the .png file I was to add it to the README.md file, and see the updated image there... any suggestion?
Best regards and thanks again!
Hi @Markkos89, Github has build-in support for rendering mermaid language syntax. Just push .md
file into github repo and check it out. On the other hand, you can render mermaid code manually on https://mermaid.live/edit
Hi @Markkos89, Github has build-in support for rendering mermaid language syntax. Just push
.md
file into github repo and check it out. On the other hand, you can render mermaid code manually on https://mermaid.live/edit
yep, that worked for now, thanks !!! The thing is I wanted to include my ERD Diagram in my README.md file, to have more exposure at first sight or something.... couldn't do it so far...
also the mermaid.live/edit doesnt show my diagram, it tells me syntax error :(
dont worry about the live editor, doesn't matter for me right now, but if you know how to see the erd.md diagram in the README.md file I will appreacite the suggestion ;)
for now I have it in another file and is showing. thanks again
I believe all that is in the generated mermaid markdown file is something like this
"""mermaid
// syntax to render ERD in markdown
"""
So if you copied the contents out of that generated markdown file and into your README.md wherever you want to put it, it should render for you.
That then leaves you manually updating your README.md any time your ERD changes. You could script that out and automate it but the easier would be to just link your README.md to your generated ERD.md
Added another option to specify the path to the binary for mmdc
in #188
Although markdown is a workaround to generate successfully, this will let you find the path to the binary so that wherever it does exist it won't throw the package not found error anymore. Let me know if you run into issues
Example repo Error:
or another error: