Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@types/katex definitions are broken since v0.14 due to default export #3574

Open
2 of 3 tasks
jameshfisher opened this issue Mar 3, 2022 · 3 comments
Open
2 of 3 tasks
Labels

Comments

@jameshfisher
Copy link
Contributor

Before reporting a bug

Describe the bug:
@types/katex definitions use named exports, but katex v0.14+ switched to using a default export.

To Reproduce:
Steps to reproduce the behavior:

  1. Install katex v0.14 or above
  2. Install @types/katex
  3. Try to use it, e.g. import { renderToString } from 'katex'
  4. See runtime error: import is undefined

Expected behavior:
Types are consistent with implementation, i.e. should only allow import katex from 'katex' if KaTeX is only exporting a default value instead of named exports

Environment (please complete the following information):

  • KaTeX Version: v0.14+

Additional context:
I have started a PR here

@edemaine
Copy link
Member

edemaine commented Mar 3, 2022

It seems like we should support import {renderToString} from 'katex' in addition to the default export, even when using ESM. @ylemkimon is this hard to do?

@Stefaans
Copy link

Stefaans commented Mar 28, 2022

@jamesfisher's pull request is failing CI tests. I am attempting another pull request:
DefinitelyTyped/DefinitelyTyped#59525

@jprinaldi
Copy link

It seems this was fixed at one point but now it's happening again. I tested with the latest versions of katex (0.16.10) and @types/katex (0.16.7).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants