Skip to content

rehype-mathjax/svg.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler' #109

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

Closed
4 tasks done
ACFancy opened this issue Feb 13, 2025 · 10 comments
Labels
🙋 no/question This does not need any changes 👎 phase/no Post cannot or will not be acted on

Comments

@ACFancy
Copy link

ACFancy commented Feb 13, 2025

Initial checklist

Affected package

"rehype-mathjax": "^7.0.0",

Steps to reproduce

rehype-mathjax/svg.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'

Actual behavior

tsconfig.json

{
	"compilerOptions": {
		"target": "esnext",
		"module": "esnext",
		"moduleResolution": "node",
		"strict": true,
		"resolveJsonModule": true,
		"jsx": "preserve",
		"lib": [
			"ESNext",
			"DOM",
			"DOM.Iterable"
		],
		"esModuleInterop": true,
		"strictNullChecks": true,
	},
	"exclude": [
		"node_modules"
	]
}

Expected behavior

rehype-mathjax/svg.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'

Runtime

[email protected]

Package manager

[email protected]

Operating system

macOS Sequoia 15.1

Build and bundle tools

No response

@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 Feb 13, 2025
@ChristianMurphy
Copy link
Member

@ACFancy have you tried setting your module option to node16, nodenext, or bundler?

@wooorm
Copy link
Member

wooorm commented Feb 13, 2025

@ACFancy your question is very minimal, and not really grammatical English. So it is very hard for me to help you.

Can you please expand your question? Did/do you have the same problem with version 6.0.0?

@wooorm wooorm added the 🙉 open/needs-info This needs some more info label Feb 13, 2025
Copy link

github-actions bot commented Feb 13, 2025

Hi! Thanks for taking the time to contribute! This has been marked by a maintainer as needing more info. It’s not clear yet whether this is an issue. Here are a couple tips:

  • Spend time framing the issue! The more time you put into it, the more we will
  • Often, maintainers respond with why for several back and forths; rubber duck debugging might help avoid that
  • Folks posting issues sometimes fall for xy problems: asking for a certain solution instead of raising the root problem

Thanks,
— bb

@shniubobo
Copy link

I have encountered the same error when I wrote this:

import rehypeMathjax from "rehype-mathjax";

This was resolved by changing it into:

import rehypeMathjax from "rehype-mathjax/svg";

@wooorm
Copy link
Member

wooorm commented Feb 17, 2025

Are you using an older bundler? Webpack 4 or so?

@remcohaszing
Copy link
Member

This is a type error, not a build error. The question is answered by @ChristianMurphy as well as in the error message in the question itself. Remove the moduleResolution option in tsconfig.json and change the module option to preserve if you use a bundler, or node16 / nodenext18 otherwise. You shouldn’t use the node10 (formerly known as node) option for moduleResolution anymore.

@shniubobo
Copy link

The bundler is vite v5.4.11.

Changing moduleResolution to bundler does solve the problem (removing the option doesn't in my case, as I'm extending from @electron-toolkit/tsconfig/tsconfig.web.json, with which moduleResolution defaults to node).

@remcohaszing
Copy link
Member

That’s a bug in @electron-toolkit/tsconfig/tsconfig.web.json. I recommend you report it to them. They should make the change I just suggested.

@remcohaszing remcohaszing closed this as not planned Won't fix, can't repro, duplicate, stale Feb 17, 2025

This comment has been minimized.

@remcohaszing remcohaszing added 🙋 no/question This does not need any changes 👎 phase/no Post cannot or will not be acted on and removed 🙉 open/needs-info This needs some more info 🤞 phase/open Post is being triaged manually labels Feb 17, 2025
Copy link

Hi! Thanks for reaching out! Because we treat issues as our backlog, we close issues that are questions since they don’t represent a task to be completed.

See our support docs for how and where to ask questions.

Thanks,
— bb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 no/question This does not need any changes 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

5 participants