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

rehype-katex breaks in production build #96

Closed
4 tasks done
losh11 opened this issue Mar 1, 2024 · 6 comments
Closed
4 tasks done

rehype-katex breaks in production build #96

losh11 opened this issue Mar 1, 2024 · 6 comments
Labels
🤷 no/invalid This cannot be acted upon 👎 phase/no Post cannot or will not be acted on

Comments

@losh11
Copy link

losh11 commented Mar 1, 2024

Initial checklist

Affected packages and versions

7.0.0 and 6.0.2

Link to runnable example

No response

Steps to reproduce

Using bun with a Nextjs 13.5.4 project. Node v18.

Expected behavior

It should work.

Actual behavior

Errors with message:

./contentlayer.config.ts:114:7
Type error: Type '(options?: Readonly<Options> | null | undefined) => (tree: Root, file: VFile) => undefined' is not assignable to type 'Pluggable<any[]>'.
  Type '(options?: Readonly<Options> | null | undefined) => (tree: Root, file: VFile) => undefined' is not assignable to type 'Plugin<any[], any, any>'.
    Type '(tree: Root, file: VFile) => undefined' is not assignable to type 'void | Transformer<any, any>'.
      Type '(tree: Root, file: VFile) => undefined' is not assignable to type 'Transformer<any, any>'.
        Types of parameters 'file' and 'file' are incompatible.
          Type 'import("/Users/loshan/Repos/ltc/foss-ltc/node_modules/vfile/lib/index").VFile' is not assignable to type 'import("/Users/loshan/Repos/ltc/foss-ltc/node_modules/rehype-katex/node_modules/vfile/lib/index").VFile'.
            Types of property 'messages' are incompatible.
              Type 'import("/Users/loshan/Repos/ltc/foss-ltc/node_modules/vfile-message/index").VFileMessage[]' is not assignable to type 'import("/Users/loshan/Repos/ltc/foss-ltc/node_modules/rehype-katex/node_modules/vfile/node_modules/vfile-message/lib/index").VFileMessage[]'.
                Type 'VFileMessage' is missing the following properties from type 'VFileMessage': ancestors, place

  112 |       rehypeSlug,
  113 |       rehypeAutolinkHeadings,
> 114 |       rehypeKatex,
      |       ^
  115 |       [rehypeCitation, { path: path.join(root, 'data') }],
  116 |       [rehypePrismPlus, { ignoreMissing: true }],
  117 |       rehypePresetMinify,
error: script "build" exited with code 1

Runtime

Other (please specify in steps to reproduce)

Package manager

npm 8, Other (please specify in steps to reproduce)

OS

Linux, macOS

Build and bundle tools

Next.js

@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 Mar 1, 2024
@ChristianMurphy
Copy link
Member

Welcome @losh11! 👋
Sorry you ran into a spot of trouble.

The issue you share appears to be a typescript error.
Make sure you are running the latest major version of all: remark, rehype, unified, and vfile dependencies.
The error indicates you likely have incompatible major versions installed currently.

@JounQin
Copy link
Member

JounQin commented Mar 1, 2024

You need provide reproduction so that we can help to check in detail.

@ChristianMurphy ChristianMurphy added the 🙊 open/needs-repro This needs a reproduction label Mar 1, 2024

This comment has been minimized.

@wooorm
Copy link
Member

wooorm commented Mar 6, 2024

Most likely: update all your tools. Raise issues with the ones that are not up to date (this package is up to date). Or add @ts-expect-error, they might just work fine.

@wooorm wooorm closed this as not planned Won't fix, can't repro, duplicate, stale Mar 6, 2024
@wooorm wooorm added 🤷 no/invalid This cannot be acted upon and removed 🤞 phase/open Post is being triaged manually 🙊 open/needs-repro This needs a reproduction labels Mar 6, 2024

This comment has been minimized.

@github-actions github-actions bot added the 👎 phase/no Post cannot or will not be acted on label Mar 6, 2024

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤷 no/invalid This cannot be acted upon 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

4 participants