-
Notifications
You must be signed in to change notification settings - Fork 64
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
Weird warning #227
Comments
@beamcode could you please please share a repro? |
Yeah happens on my simple personal website https://github.com/beamcode/beamcode.dev/ |
I think it's a react thing... a simple refactoring sorted it for me:
|
thanks! PR for this would be appreciated. |
I have the same issue with next-mdx-remote : [Shiki] 160 instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call `highlighter.dispose()` to release unused instances.
const { frontmatter, content } = await compileMDX<PostMetadata>({
source: contentFilePath,
options: {
mdxOptions: {
remarkPlugins: [],
rehypePlugins: [
[
rehypePrettyCode,
{
theme: "vitesse-dark",
},
],
[rehypeSlug],
],
},
parseFrontmatter: true,
},
}); i made this change in a clone of rehype-pretty-code, installed it in a next js project and the singleton warning disappeared. import {
type Highlighter,
type CodeToHastOptions,
getSingletonHighlighter as defaultGetHighlighter,
} from 'shiki'; getHighlighter is deprecated |
[Shiki] 10 instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call
highlighter.dispose()
to release unused instances.Not sure if this is me or Rpc
The text was updated successfully, but these errors were encountered: