bitttttten / jest-transformer-mdx

A jest transformer for MDX with frontMatter support
12 stars 6 forks source link

Couldn't setup with Next #11

Closed eric-burel closed 4 years ago

eric-burel commented 4 years ago

Hi,

I've tried to install 2.2.0 with Next, and I obtain this object when importing a .md as a component:

import Readme from "../../../README.md";
console.log("readme", Readme);
// will print { process: [Function: createTransformer] } instead of a React component

Any idea where to begin to debug this? It feels like jest-transformer-mdx is not completely loaded or smth like that.

Using jest 26.

I can provide a repro if necessary, not really minimal though.

eric-burel commented 4 years ago

Dumb mistake, I was importing it in moduleNameMapper instead of transform so it behaved as an alias, replacing my import with the lib instead of parsing the file...$

Thanks for this lib, works so great!

bitttttten commented 4 years ago

Ah cool! I will update the readme to include instructions for next :) Are you on next 9.3?

eric-burel commented 4 years ago

I use the latest version, so 9.4.4 I think (it's an open source project: https://github.com/VulcanJS/vulcan-next-starter). I think the current docs are ok, it works the same way than in other JS app.

bitttttten commented 4 years ago

Great, then no action needed. Your vulcan next starter looks great btw, all the best!