Skip to content

fix: lazy-import katex in math plugin helpers#272

Open
saschabuehrle wants to merge 1 commit into
comarkdown:mainfrom
saschabuehrle:fix/issue-271
Open

fix: lazy-import katex in math plugin helpers#272
saschabuehrle wants to merge 1 commit into
comarkdown:mainfrom
saschabuehrle:fix/issue-271

Conversation

@saschabuehrle

Copy link
Copy Markdown

Fixes #271

katex is declared as an optional peer dep but the static top-level import makes it blow up with ERR_MODULE_NOT_FOUND when katex isn't installed. The plugin itself never calls katex directly — only renderMath and validateMath do.

Switched both helpers to dynamic import('katex') so the module loads fine without katex. Makes both functions async (breaking for direct callers, but neither is called internally).

— saschabuehrle

@saschabuehrle saschabuehrle requested a review from farnabaz as a code owner July 6, 2026 13:41
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

@saschabuehrle is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Math plugin statically imports katex despite it being declared an optional peerDependency

1 participant