Mdx: Compiler API: createCompiler is not a function

Created on 22 Apr 2020  路  2Comments  路  Source: mdx-js/mdx

Subject of the issue

Per https://mdxjs.com/advanced/api#compiler, I should be able to access the compiler like this:

const { createCompiler } = require('@mdx-js/mdx')

However, when I try to do that, I get the following error:

TypeError: createCompiler is not a function

When I look at node_modules/@mdx-js/mdx/index.js, I see that createMdxAstCompiler is the only compiler creation function exported.

Your environment

  • OS: macOS 10.14.6
  • Packages: @mdx-js/mdx ^1.5.8
  • Env: node 10.18.1, npm 6.13.4

Steps to reproduce

Run the example on https://mdxjs.com/advanced/api#compiler with the latest version of all dependencies.

Expected behaviour

{ title: "Hello, MDX" } should be logged to the console.

Actual behaviour

The program crashes with the following error:

TypeError: createCompiler is not a function
馃檵 typquestion

Most helpful comment

That did the trick! Thanks much @johno 馃檹

All 2 comments

Thanks for opening an issue @nwalters512! Can you bump MDX to 1.5.9 (just cut a new release) and see if that fixes your issue?

That did the trick! Thanks much @johno 馃檹

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aress31 picture aress31  路  19Comments

atanasster picture atanasster  路  15Comments

johno picture johno  路  21Comments

adamwathan picture adamwathan  路  12Comments

jeetiss picture jeetiss  路  12Comments