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

mdx-table-of-contents not working with next.js #71

Open
adamsoffer opened this issue Aug 20, 2020 · 0 comments
Open

mdx-table-of-contents not working with next.js #71

adamsoffer opened this issue Aug 20, 2020 · 0 comments

Comments

@adamsoffer
Copy link

adamsoffer commented Aug 20, 2020

I'm attempting to use the mdx-table-of-contents package with next.js but when I import the tableOfContents object it's undefined:

import Document , { tableOfContents } from "../../../reference-api.mdx";

Here's what my next.config.js file looks like:

const toc = require("mdx-table-of-contents");
const withMDX = require("@next/mdx")({
  options: {
    remarkPlugins: [toc],
  },
  extension: /\.mdx?$/,
});

module.exports = withMDX({
  pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx", "svg"],
});

Any idea what I'm doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant