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

Mathjax Docs are Incorrect Due to Removal of index.js #87

Closed
nkeil opened this issue Oct 4, 2023 · 3 comments
Closed

Mathjax Docs are Incorrect Due to Removal of index.js #87

nkeil opened this issue Oct 4, 2023 · 3 comments
Labels
☂️ area/types This affects typings 🤷 no/invalid This cannot be acted upon 👎 phase/no Post cannot or will not be acted on

Comments

@nkeil
Copy link

nkeil commented Oct 4, 2023

Affected packages and versions

Rehype-Mathjax v5.0.0

Steps to reproduce

In the commit 4223ed9, rehype-mathjax/index.js was removed. This has resulted in our existing code failing when upgrading to 5.0.0.

import rehypeMathJax from 'rehype-mathjax';

This method of importing is currently recommended on the documentation. Either a default export should be added back, or the docs should be updated to use one of the other ways of importing (/browser, /svg, etc.)

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Oct 4, 2023
@nkeil
Copy link
Author

nkeil commented Oct 4, 2023

After some more research, I discovered that this issue was due to an ESM incompatibility with the exports field in package.json (link). Because "type": "module" would be a big headache, I just changed the tsconfig to "moduleResolution": "bundler" (this is using Next.js), and the default export worked.

@nkeil nkeil closed this as completed Oct 4, 2023
@github-actions

This comment was marked as resolved.

@remcohaszing
Copy link
Member

I just changed the tsconfig to "moduleResolution": "bundler"

I'm just confirming this is the correct setting for bundlers such as Next.js. You also need "module": "esnext", but you probably already have that.

@remcohaszing remcohaszing added 🤷 no/invalid This cannot be acted upon ☂️ area/types This affects typings labels Oct 4, 2023
@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually labels Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☂️ area/types This affects typings 🤷 no/invalid This cannot be acted upon 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

2 participants