Repository navigation
Closed
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionstatus: needs triageThis issue has not been triaged by maintainers
Description
🐛 Bug Report
I am trying to use the plugin-ideal-image plugin, however despite installing and configuring, it throws an error to say it cannot find it. I can confirm that the plugin exists in my node_modules
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
-
Install
plugin-ideal-imagewithnpm i --save @docusaurus/plugin-ideal-image. This adds the dependency"@docusaurus/plugin-ideal-image": "^2.0.0-alpha.39", -
Add the plugin to my
docusaurus.config.jsfile:
plugins: ['@docusaurus/plugin-ideal-image'], -
Import the plugin and use in my mdx file:
import Image from '@theme/IdealImage';
<Image img={require('./img.png')} />
npm run start
Expected behavior
Image is loaded and displayed in documentation
Actual Behavior
Docusaurus fails to start with the below error:
Error: Cannot find module '@docusaurus/plugin-ideal-image'
Require stack:
- C:\Users\Greg\Documents\Projects\assistant-relay\doc-src\website
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
at Function.resolve (internal/modules/cjs/helpers.js:78:19)
at C:\Users\Greg\Documents\Projects\assistant-relay\doc-src\website\node_modules\@docusaurus\core\lib\server\plugins\init.js:40:67
at Array.map (<anonymous>)
at Object.initPlugins (C:\Users\Greg\Documents\Projects\assistant-relay\doc-src\website\node_modules\@docusaurus\core\lib\server\plugins\init.js:22:10)
at Object.loadPlugins (C:\Users\Greg\Documents\Projects\assistant-relay\doc-src\website\node_modules\@docusaurus\core\lib\server\plugins\index.js:47:28)
at Object.load (C:\Users\Greg\Documents\Projects\assistant-relay\doc-src\website\node_modules\@docusaurus\core\lib\server\index.js:57:62)
at start (C:\Users\Greg\Documents\Projects\assistant-relay\doc-src\website\node_modules\@docusaurus\core\lib\commands\start.js:45:34)
at C:\Users\Greg\Documents\Projects\assistant-relay\doc-src\website\node_modules\@docusaurus\core\bin\docusaurus.js:29:5
at Command.<anonymous> (C:\Users\Greg\Documents\Projects\assistant-relay\doc-src\website\node_modules\@docusaurus\core\bin\docusaurus.js:97:23)
at Command.listener (C:\Users\Greg\Documents\Projects\assistant-relay\doc-src\website\node_modules\commander\index.js:370:29)
at Command.emit (events.js:315:20)
at Command.parseArgs (C:\Users\Greg\Documents\Projects\assistant-relay\doc-src\website\node_modules\commander\index.js:892:12)
at Command.parse (C:\Users\Greg\Documents\Projects\assistant-relay\doc-src\website\node_modules\commander\index.js:642:21)
at Object.<anonymous> (C:\Users\Greg\Documents\Projects\assistant-relay\doc-src\website\node_modules\@docusaurus\core\bin\docusaurus.js:120:5)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
Your Environment
- Docusaurus version used: 2.0.0-alpha.56
- Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): Node 12.17.0
- Operating system and version (desktop or mobile): Windows 10 x64
Metadata
Metadata
Assignees
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionstatus: needs triageThis issue has not been triaged by maintainers
Activity
lex111 commentedon May 28, 2020
Please read the release notes carefully. https://github.com/facebook/docusaurus/releases/tag/v2.0.0-alpha.56
SamChou19815 commentedon May 28, 2020
I think the real issue here is that you are using an old@docusaurus/plugin-ideal-image. The latest should be alpha-56.I am able to reproduce this problem. Working on a fix now.