question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failing to build with 2.0: Error: Cannot find module 'wait-file'

See original GitHub issue

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I’m using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn 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

Self-service

  • I’d be willing to fix this bug myself.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Josh-Cenacommented, Aug 2, 2022

Yes, we should rename the current version on the website to 2.0.1. @slorber WDYT?

0reactions
slorbercommented, Aug 8, 2022

will update the version name in https://github.com/facebook/docusaurus/pull/7922

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found