Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
5 of 7 tasks
johnnyreilly opened this issue Aug 1, 2022 · 13 comments
Closed
5 of 7 tasks

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

johnnyreilly opened this issue Aug 1, 2022 · 13 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@johnnyreilly
Copy link
Contributor

johnnyreilly commented Aug 1, 2022

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: johnnyreilly/blog.johnnyreilly.com#276

Expected behavior

Build should succeed

Actual behavior

Build should fail - see above and johnnyreilly/blog.johnnyreilly.com#276

Your environment

Self-service

  • I'd be willing to fix this bug myself.
@johnnyreilly johnnyreilly added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Aug 1, 2022
@Josh-Cena
Copy link
Collaborator

What...? We migrated away from wait-file two years ago! Could you try installing it locally?

@Josh-Cena Josh-Cena added status: needs more information There is not enough information to take action on the issue. and removed status: needs triage This issue has not been triaged by maintainers status: needs more information There is not enough information to take action on the issue. labels Aug 1, 2022
@Josh-Cena
Copy link
Collaborator

Never mind, this file is corrupted somehow:

https://unpkg.com/browse/@docusaurus/[email protected]/lib/webpack/plugins/WaitPlugin.js

@johnnyreilly
Copy link
Contributor Author

https://github.com/johnnyreilly/blog.johnnyreilly.com/actions/runs/2772875207

Adding it directly to the project fixes the build by the looks of it: yarn add wait-file -D

@Josh-Cena
Copy link
Collaborator

You shouldn't need to... that file is suddenly reverted to the 2-year-ago version

@johnnyreilly
Copy link
Contributor Author

Super weird

@slorber
Copy link
Collaborator

slorber commented Aug 1, 2022

fixed in 2.0.1

@slorber slorber closed this as completed Aug 1, 2022
@johnnyreilly
Copy link
Contributor Author

I think you can still republish - if I recall there's like a 48 window where you can do that with npm modules

@Josh-Cena
Copy link
Collaborator

Yes, that's what I remember too.

@rguldener
Copy link

rguldener commented Aug 2, 2022

Also getting this error after upgrading to 2.0.0, just ran npm install on 2.0.0 10 minutes ago (so I guess the 2.0.0 packages haven't been patched retroactively yet?).
Is 2.0.1 available somewhere or how can I get the fixed version?

As a side note, GitHub still lists 2.0.0-rc1 as the latest release and the changelog for 2.0.0 is also missing: https://docusaurus.io/changelog
Let me know if I should open separate issues for these

@Josh-Cena
Copy link
Collaborator

2.0.1 was released more than 24 hours ago. See https://www.npmjs.com/package/@docusaurus/core?activeTab=versions

@slorber Could you update the GitHub release?

@rguldener
Copy link

Thanks for the swift reply @Josh-Cena, didn't check NPM and didn't realize 2.0.1 is out because the docs & everything else only mention 2.0.0. Should have checked NPM I guess :)

I actually followed the update guide and since that also mentioned putting 2.0.0 into package.json that is just what I did: https://docusaurus.io/docs/installation#updating-your-docusaurus-version
Just as a heads up, might be worth changing 2.0.0 to 2.0.1 (or whatever the latest patch is) at least there :)

@Josh-Cena
Copy link
Collaborator

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

@slorber
Copy link
Collaborator

slorber commented Aug 8, 2022

will update the version name in #7922

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

No branches or pull requests

4 participants