Local (Remark) Plugin does not resolve
leifniem opened this issue · comments
Describe the bug
I configured gatsby-config.js
to include a local remark plugin and receive the following error message:
Error: Cannot find module 'gatsby-remark-images-remove-wrapper'
Require stack:
- /Volumes/Files/Users/leif/dev_stuff/port/node_modules/gatsby-mdx/gatsby/extend-node-type.js
- /Volumes/Files/Users/leif/dev_stuff/port/node_modules/gatsby-mdx/gatsby-node.js
- /Volumes/Files/Users/leif/dev_stuff/port/node_modules/gatsby/dist/bootstrap/resolve-module-exports.js
- /Volumes/Files/Users/leif/dev_stuff/port/node_modules/gatsby/dist/bootstrap/load-plugins/validate.js
- /Volumes/Files/Users/leif/dev_stuff/port/node_modules/gatsby/dist/bootstrap/load-plugins/load.js
- /Volumes/Files/Users/leif/dev_stuff/port/node_modules/gatsby/dist/bootstrap/load-plugins/index.js
- /Volumes/Files/Users/leif/dev_stuff/port/node_modules/gatsby/dist/bootstrap/index.js
- /Volumes/Files/Users/leif/dev_stuff/port/node_modules/gatsby/dist/commands/develop.js
- /Volumes/Files/Users/leif/dev_stuff/port/node_modules/gatsby-cli/lib/create-cli.js
- /Volumes/Files/Users/leif/dev_stuff/port/node_modules/gatsby-cli/lib/index.js
- /Volumes/Files/Users/leif/dev_stuff/port/node_modules/gatsby/dist/bin/gatsby.js
Not sure if this an error on my end and i need to import the module or an issue with gatsby-mdx
To Reproduce
Add local plugin to gatsbyRemarkPlugins
in gatsby-config.js
Expected behavior
Plugin is found gets invoked when processing mdx files
Additional Context
Folder structure in local plugins folder is as follows:
plugins
└── gatsby-remark-images-remove-wrapper
├── index.js
├── node_modules
├── package.json
└── yarn.lock
I've had the same issue, seems that gatsby-mdx isn't picking up local plugins from the "plugins" folder...
My solution was to manually require it, as you can see here: https://github.com/PedroLamas/pedrolamas.com/blob/gatsby/gatsby-config.js#L55