remcohaszing / rehype-mermaid

A rehype plugin to render mermaid diagrams
MIT License
68 stars 8 forks source link

Updating to 2.0.0 caused an error in Contentlayer config #4

Closed tifandotme closed 11 months ago

tifandotme commented 11 months ago
contentlayer.config.ts:186:9 - error TS2322: Type 'Plugin<[(RehypeMermaidOptions | undefined)?], Root>' is not assignable to type 'Plugin<any[], any, any>'.
  The 'this' types of each signature are incompatible.
    Type 'Processor<void, any, void, void> | Processor<void, any, any, any> | Processor<any, any, void, void> | Processor<void, void, void, void>' is not assignable to type 'Processor<undefined, undefined, undefined, undefined, undefined>'.
      Type 'Processor<void, any, void, void>' is missing the following properties from type 'Processor<undefined, undefined, undefined, undefined, undefined>': compiler, freezeIndex, frozen, namespace, and 3 more.

Got this type error after updating to v2, any idea on how to fix this? Previous version prior to 2.0.0 was working just fine

Thanks

tifandotme commented 11 months ago

I think it as something to do with this? https://github.com/unifiedjs/unified/issues/228

remcohaszing commented 11 months ago

Yes, it's exactly that. You should update rehype-mermaidjs along with the other plugins. It's just a type error though. It's mostly baclwards compatible.