Closed vadimgo closed 1 year ago
A possible quick fix until a permanent solution would be to fix the dependency of gatsby-remark-external-links to version 1.0.2 of unist-util-find.
Hi!
Thanks for the issue! We've updated our packages to use a pinned version, but the plugin you have problems with is a community plugin: https://github.com/JLongley/gatsby-remark-external-links
So you'll have to wait for a 1.0.4 release or use another way of forcing the version.
Thank you for the update. For now as a workaround, I've switched from using gatsby-remarl-external-links to remark-exterbal-links via mdxOptions / remarkPlugins when resolving gatsby-plugin-mdx.
Preliminary Checks
Description
Due to unist-util-find version 1.0.3 update to ESM, gatsby-remark-external-links is broken resulting in a build error when it is used:
Error: [ERR_REQUIRE_ESM]: require() of ES Module /home/vadim/mauka/my-gatsby-site/node_modules/unist-util-find/index.js from /home/vadim/mauka/my-gatsby-site/node_modu les/gatsby-remark-external-links/index.js not supported. Instead change the require of /home/vadim/mauka/my-gatsby-site/node_modules/unist-util-find/index.js in /home/vadim/mauka/my-gatsby-site/node_modules/gatsby-remark-ext ernal-links/index.js to a dynamic import() which is available in all CommonJS modules.
Reproduction Link
https://github.com/gatsbyjs/gatsby-starter-minimal-ts
Steps to Reproduce
1) npm init gatsby -- -ts
with mdx support enabled
2) npm install gatsby-remark-external-links 3) In gatsby-config.ts replace "gatsby-plugin-mdx" with
4) npm run build 5) Observe the build error
Expected Result
No build error.
Actual Result
Build error:
Error: [ERR_REQUIRE_ESM]: require() of ES Module /home/vadim/mauka/my-gatsby-site/node_modules/unist-util-find/index.js from /home/vadim/mauka/my-gatsby-site/node_modu les/gatsby-remark-external-links/index.js not supported. Instead change the require of /home/vadim/mauka/my-gatsby-site/node_modules/unist-util-find/index.js in /home/vadim/mauka/my-gatsby-site/node_modules/gatsby-remark-ext ernal-links/index.js to a dynamic import() which is available in all CommonJS modules.
Environment
Config Flags
No response