Failing to build with 2.0: Error: Cannot find module 'wait-file'
See original GitHub issueHave you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I’m using the latest version of Docusaurus.
- I have tried the
npm run clear
oryarn clear
command. - I have tried
rm -rf node_modules yarn.lock package-lock.json
and re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
When I try to build with Docusaurus 2.0 I experience an error which you can see here
> docusaurus build
node:internal/modules/cjs/loader:933
const err = new Error(message);
^
Error: Cannot find module 'wait-file'
Require stack:
- /home/runner/work/blog.johnnyreilly.com/blog.johnnyreilly.com/blog-website/node_modules/@docusaurus/core/lib/webpack/plugins/WaitPlugin.js
- /home/runner/work/blog.johnnyreilly.com/blog.johnnyreilly.com/blog-website/node_modules/@docusaurus/core/lib/webpack/server.js
- /home/runner/work/blog.johnnyreilly.com/blog.johnnyreilly.com/blog-website/node_modules/@docusaurus/core/lib/commands/build.js
- /home/runner/work/blog.johnnyreilly.com/blog.johnnyreilly.com/blog-website/node_modules/@docusaurus/core/lib/index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:[77](https://github.com/johnnyreilly/blog.johnnyreilly.com/runs/7605731556?check_suite_focus=true#step:4:78)8:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/home/runner/work/blog.johnnyreilly.com/blog.johnnyreilly.com/blog-website/node_modules/@docusaurus/core/lib/webpack/plugins/WaitPlugin.js:10:20)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:9[81](https://github.com/johnnyreilly/blog.johnnyreilly.com/runs/7605731556?check_suite_focus=true#step:4:82):32)
at Function.Module._load (node:internal/modules/cjs/loader:[82](https://github.com/johnnyreilly/blog.johnnyreilly.com/runs/7605731556?check_suite_focus=true#step:4:83)2:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/runner/work/blog.johnnyreilly.com/blog.johnnyreilly.com/blog-website/node_modules/@docusaurus/core/lib/webpack/plugins/WaitPlugin.js',
'/home/runner/work/blog.johnnyreilly.com/blog.johnnyreilly.com/blog-website/node_modules/@docusaurus/core/lib/webpack/server.js',
'/home/runner/work/blog.johnnyreilly.com/blog.johnnyreilly.com/blog-website/node_modules/@docusaurus/core/lib/commands/build.js',
'/home/runner/work/blog.johnnyreilly.com/blog.johnnyreilly.com/blog-website/node_modules/@docusaurus/core/lib/index.js'
]
}
Error: Process completed with exit code 1.
Reproducible demo
No response
Steps to reproduce
Try to build this branch: https://github.com/johnnyreilly/blog.johnnyreilly.com/pull/276
Expected behavior
Build should succeed
Actual behavior
Build should fail - see above and https://github.com/johnnyreilly/blog.johnnyreilly.com/pull/276
Your environment
- Public source code: https://github.com/johnnyreilly/blog.johnnyreilly.com
- Public site URL: https://blog.johnnyreilly.com
- Docusaurus version used: 2.0
- Environment name and version (e.g. Chrome 89, Node.js 16.4): Node 16
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): Ubuntu
Self-service
- I’d be willing to fix this bug myself.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Error: Cannot find module '/app/wait-for-it.sh"' - Stack Overflow
I tried to build it without wait-for-it.sh and it was complaining that the server cannot connect to the Postgres DB and Redis, so...
Read more >"Cannot find module" when main file not index.js with ... - GitHub
If you use explicit extensions, and don't use experimental specifier resolution, what happens? Then the script runs correctly. 2
Read more >wait-on - npm
wait-on is a cross platform command line utility and Node.js API which will wait for files, ports, sockets, and http(s) resources to become ......
Read more >Fix Global Installs Not Working | "Cannot find module" error FIX
Getting " Cannot find module " after installing something globally (with -g)? Well, this video shows you how to fix global package/module ...
Read more >richardnguyen99 - Netlify Support Forums
I'm having a problem with gatsby build when deploying on Netlify. So the error looks ... Netlify constantly builds gatsby failed: "Cannot find...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, we should rename the current version on the website to
2.0.1
. @slorber WDYT?will update the version name in https://github.com/facebook/docusaurus/pull/7922