Coder Social home page Coder Social logo

Comments (5)

ChristianMurphy avatar ChristianMurphy commented on August 17, 2024

This is not an issue with remark-math, rehype-katex, ormdx. I'm not sure it's an issue with next either.
Running MDX 2 and Next 12, with the official @mdx-js/loader, it's able to run remark-math and rehype-katex fine.
https://codesandbox.io/s/next-mdx-math-katex-vd1qx?file=/next.config.mjs

next.config.mjs
// ⚠️ Important! Please make sure the dependencies are up to date.
import remarkMath from "remark-math";
import rehypeKatex from "rehype-katex";


const configuration = {
  // Support MDX files as pages:
  pageExtensions: ["md", "mdx", "tsx", "ts", "jsx", "js"],
  // Support loading `.md`, `.mdx`:
  webpack(config, options) {
    config.module.rules.push({
      test: /\.mdx?$/,
      use: [
        // The default `babel-loader` used by Next:
        options.defaultLoaders.babel,
        {
          loader: "@mdx-js/loader",
          /** @type {import('@mdx-js/loader').Options} */
          options: {
            /* jsxImportSource: …, otherOptions… */
            remarkPlugins: [remarkMath],
            rehypePlugins: [rehypeKatex]
          },
        },
      ],
    });

    return config;
  },
};

export default configuration;

This is likely related to using mdx 1 (https://github.com/msukmanowsky/rehype-katex-issue/blob/8967ab668bbb59aae1354991728589eb271222cb/package.json#L11) with remark and rehype plugins which are compatible with mdx 2 (https://codesandbox.io/s/next-mdx-math-katex-vd1qx?file=/package.json)

As for the log you provide, it may be a next issue, there are a number of open issues related to caching strategy https://github.com/vercel/next.js/issues?q=is%3Aissue+is%3Aopen+webpack.cache.PackFileCacheStrategy
It should not however cause the issue you are seeing.

from remark-math.

github-actions avatar github-actions commented on August 17, 2024

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

from remark-math.

github-actions avatar github-actions commented on August 17, 2024

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

from remark-math.

eric-burel avatar eric-burel commented on August 17, 2024

Hi, for the record rehype-mathjax doesn't have an error message but seems to fail silently as well. Will try mdx v2.

from remark-math.

ChristianMurphy avatar ChristianMurphy commented on August 17, 2024

@eric-burel if @next/mdx is silently swallowing errors it would be something to raise with the maintainers https://github.com/vercel/next.js/issues

from remark-math.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.