emersonbottero / vitepress-plugin-mermaid

Add mermaid support for Vitepress
MIT License
87 stars 20 forks source link

"vitepress-plugin-mermaid" has no exported member 'withMermaid' #46

Closed Intevel closed 1 year ago

Intevel commented 1 year ago

image

emersonbottero commented 1 year ago

It exports in here https://github.com/emersonbottero/vitepress-plugin-mermaid/blob/d525ea65046dc1d041e99e07bc0f4a6c7540eb82/src/index.ts#L14

Can you share your repo?

CorvusYe commented 1 year ago

Hi, @emersonbottero

I also encountered this problem. Perhaps we need to check if the source code of Github matches the package of NPM.

https://www.npmjs.com/package/vitepress-plugin-mermaid?activeTab=code

Intevel commented 1 year ago

Hi, @emersonbottero

I also encountered this problem.

Perhaps we need to check if the source code of Github matches the package of NPM.

https://www.npmjs.com/package/vitepress-plugin-mermaid?activeTab=code

It doesn't match. On npm only the render function is exported.

Intevel commented 1 year ago

@emersonbottero Can you please publish a new version?

emersonbottero commented 1 year ago

can you lock the version to the previous working one? My fix PR should be released this Wednesday by mermaid team and I have an unpublished version with lot of fixes waiting just for that..

CorvusYe commented 1 year ago

This doesn't seem to work very well. Thanks all the same.

image

package.json :

{
  "name": "ngbatis-docs",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "docs:dev": "vitepress dev docs",
    "docs:build": "vitepress build docs",
    "docs:preview": "vitepress preview docs"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "vitepress": "1.0.0-alpha.76",
    "vitepress-plugin-mermaid": "^2.0.8"
  }
}
emersonbottero commented 1 year ago

try that combination.. image

you must remove ^ from the mermaid version

Intevel commented 1 year ago

try that combination.. image

you must remove ^ from the mermaid version

But this is a workaround, not a real fix. Maybe you just publish the current version?

Intevel commented 1 year ago

Btw, this doesnt work with this versions.

emersonbottero commented 1 year ago

can you share your repo? and the problem is with mermaid.. no this plugin.. once mermaid fix it you can install the last version of mermaid

CorvusYe commented 1 year ago

This is my repo, but it doesn't dependent this plugin now.

https://github.com/graph-cn/ngbatis-docs

mermaid page https://github.com/graph-cn/ngbatis-docs/blob/master/docs/step-forward-docs/operation-sequence.md

emersonbottero commented 1 year ago

image

I made an PR for you

CorvusYe commented 1 year ago

image

I made an PR for you

I see the effect. This is awesome. Thank you so much.

skanehira commented 1 year ago

I have same problem. I cannot find index.ts in the dist direcotry.

skanehira@gorilla this-week-in-gorilla/node_modules/vitepress-plugin-mermaid 
$ tree .   
.
├── LICENSE
├── README.md
├── dist
│   ├── Mermaid.vue
│   ├── mermaid.ts
│   ├── vitepress-plugin-mermaid.es.mjs
│   └── vitepress-plugin-mermaid.umd.js
├── node_modules
└── package.json

3 directories, 7 files

I tried the following, but index.ts still does not exist.

https://github.com/emersonbottero/vitepress-plugin-mermaid/issues/46#issuecomment-1558191500

How can I solve this problem? My repo is https://github.com/skanehira/this-week-in-gorilla

Intevel commented 1 year ago

It works for some reason to import, however it still shows as an error. What to use @ts-expect-error for TypeScript projects

Intevel commented 1 year ago

Still occurs in 2.0.11

Intevel commented 1 year ago

Fixed in #48, for temporary usage you can use @intevel/vitepress-plugin-mermaid@2.0.15

CorvusYe commented 1 year ago

@Intevel image In my environment, although it also reports errors, it is indeed usable.

Intevel commented 1 year ago

@Intevel image In my environment, although it also reports errors, it is indeed usable.

I just made a PR which fixes that, until its released you can use my version of publish:


npm install @intevel/vitepress-plugin-mermaid@2.0.15
// or 
yarn add @intevel/vitepress-plugin-mermaid@2.0.15