KaTeX/KaTeX

Katex Bundle Shipping To Client In NextJS 13 when using SSR

oliverkidd opened this issue · 0 comments

Describe the bug:
Our project is using Katex for server side rendering in a nextjs13 app dir project. Katex is only imported and referenced in server side static pages so that all rendering takes place at build time.

However, the entire katex library is being sent to the client bundle despite it never being used there. Just importing katex server side results in it being included in the client bundle - even without any usage.

Expected behavior:
The library would only be shipped to the client bundle if katex was imported to a client facing component.

Environment:

  • KaTeX Version: latest version
  • Device: Mac