Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find module '@mdx-js/mdx' - Gatsby

After the last update of today i'm getting this error. I'm using no MDX in my project howsoever..

npm run develop produces this issue, does someone has some knowledge about this?

internal/modules/cjs/loader.js:979
  throw err;
  ^

Error: Cannot find module '@mdx-js/mdx'
Require stack:
- /Users/mikey/Sites/Gimmix/node_modules/gatsby-recipes/dist/transform-recipe-mdx.js
- /Users/mikey/Sites/Gimmix/node_modules/gatsby-recipes/dist/renderer/index.js
- /Users/mikey/Sites/Gimmix/node_modules/gatsby-recipes/dist/validate-steps.js
- /Users/mikey/Sites/Gimmix/node_modules/gatsby-recipes/dist/recipe-machine/index.js
- /Users/mikey/Sites/Gimmix/node_modules/gatsby-recipes/dist/graphql-server/server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:976:15)
    at Function.Module._load (internal/modules/cjs/loader.js:859:27)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/mikey/Sites/Gimmix/node_modules/gatsby-recipes/dist/transform-recipe-mdx.js:12:35)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Module.require (internal/modules/cjs/loader.js:1036:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/mikey/Sites/Gimmix/node_modules/gatsby-recipes/dist/transform-recipe-mdx.js',
    '/Users/mikey/Sites/Gimmix/node_modules/gatsby-recipes/dist/renderer/index.js',
    '/Users/mikey/Sites/Gimmix/node_modules/gatsby-recipes/dist/validate-steps.js',
    '/Users/mikey/Sites/Gimmix/node_modules/gatsby-recipes/dist/recipe-machine/index.js',
    '/Users/mikey/Sites/Gimmix/node_modules/gatsby-recipes/dist/graphql-server/server.js'
  ]
}
like image 959
mikeyfe6 Avatar asked Sep 07 '20 16:09

mikeyfe6


People also ask

What is the MDX file in The Great Gatsby?

MDX is an extension to Markdown that lets you include JSX in Markdown documents. MDX makes it possible to include React components in your Gatsby blog posts and pages. Markdown defines a plain text syntax for HTML elements such as h1 , strong , and a , but still supports inline HTML.

Can you import in .MDX file?

JavaScript enginesMDX files can be imported in Node by using @mdx-js/node-loader (strongly recommended) or alternatively they can be require d with the legacy package @mdx-js/register .

What is MDX react?

It is a format that lets you seamlessly use JSX in your Markdown documents. MDX is fast, has no runtime compilation, provides customizable layouts, easily pluggable to existing projects and can import components, like interactive charts, and export metadata.


1 Answers

Problem is solved with the latest update(s): 😁

[email protected] ([email protected]) ([email protected]) ([email protected])

delete your cache gatsby clean

Be sure to also update your gatsby-cli: npm i -g gatsby-cli

delete your node_modules & packages for a clean install rm -rf node_modules package-lock.json

last but not least npm install --save

and test your building proces npm run develop

like image 74
mikeyfe6 Avatar answered Sep 28 '22 19:09

mikeyfe6