Docusaurus: (v2) "ENOENT: no such file or directory" after upgrading from alpha.61 to alpha.62

Created on 30 Aug 2020  路  15Comments  路  Source: facebook/docusaurus

Thanks for everyone's work on this awesome product. It has been really useful for us.

馃悰 Bug Report

When running npm run build after upgrading from alpha.61 to alpha.62, the website does not build, and this output is repeated for many/all pages:

(node:35940) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/Users/me/workspace/pact-foundation/docs.pact.io/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-pact-broker-2-lib-pact-broker-doc-views-index-pacticipant-version-tag-md-c69.json'

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

Upgrade from alpha.61 to alpha.62 as per commit https://github.com/pact-foundation/docs.pact.io/commit/e650d27f768c69805bd8822122f0274ff063a555

These two branches show the difference in the package.json and behaviour.

git clone [email protected]:pact-foundation/docs.pact.io.git
cd docs.pact.io/website
npm i
npm run build # this will succeed, as it's on alpha.61

git checkout chore/docusaurus-alpha-62
npm i
npm run build # this hangs and has numerous lines of error output

Expected behavior

Build completes successfully as per https://travis-ci.com/github/pact-foundation/docs.pact.io/builds/181930983

Actual Behavior

Build hangs, screen is filled with errors in the following format, as per https://travis-ci.com/github/pact-foundation/docs.pact.io/builds/181931029

(node:35940) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/Users/me/workspace/pact-foundation/docs.pact.io/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-pact-broker-2-lib-pact-broker-doc-views-index-pacticipant-version-tag-md-c69.json'

Your Environment

  • Docusaurus version used: docusaurus/core 2.0.0-alpha.62
  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): node v12.0.0
  • Operating system and version (desktop or mobile): Mac desktop

Reproducible Demo

As per reproduction steps.

bug needs triage

All 15 comments

Hi,

Have you tried building locally, not on Travis? Is there an option to "clear cache" in Travis or something?

I only created the Travis build to demonstrate the problem for this issue. It uses a clean workspace each time. The issue happens locally on my mac, and also on Netlify (see this build here https://app.netlify.com/sites/docs-pact-io/deploys/5f4b05887660070007b38902).

There may have been some documentation on upgrade steps between 61 and 62 that I missed, but I couldn't find any, and the search wasn't working on the v2.docusaurus website on the weekend.

Thanks for looking into it.

I see the same when building (yarn build) on Netlify. When running the development server (yarn start) I am seeing:

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
    at Hash.update (internal/crypto/hash.js:82:11)
    at Object.generate (M:\Git\data.home-assistant\node_modules\@docusaurus\core\node_modules\@docusaurus\utils\lib\index.js:40:52)
    at createData (M:\Git\data.home-assistant\node_modules\@docusaurus\core\lib\server\plugins\index.js:76:27)
    at async Object.contentLoaded (M:\Git\data.home-assistant\node_modules\@docusaurus\plugin-debug\lib\index.js:23:36)
    at async M:\Git\data.home-assistant\node_modules\@docusaurus\core\lib\server\plugins\index.js:92:9
    at async Promise.all (index 3)
    at async Object.loadPlugins (M:\Git\data.home-assistant\node_modules\@docusaurus\core\lib\server\plugins\index.js:65:5)
    at async Object.load (M:\Git\data.home-assistant\node_modules\@docusaurus\core\lib\server\index.js:78:58)
    at async start (M:\Git\data.home-assistant\node_modules\@docusaurus\core\lib\commands\start.js:44:19)

Affected PRs (contain links to the builds in checks)
home-assistant/data.home-assistant#81 home-assistant/data.home-assistant#82
home-assistant/developers.home-assistant#628 home-assistant/developers.home-assistant#629
home-assistant/companion.home-assistant#318 home-assistant/companion.home-assistant#319

@TomBrien the dev error is something else. You should get it fixed by using "debug: false" on the classic preset config, but can you help me reproduce it? I tried running your data home assistant repo from master, and upgrading to alpha 62 does not produce this error in dev on my computer. Can you open a dedicated separate issue with repro steps please?

I was able to run home assistant both with yarn start and yarn build.

Edit:: PR: https://github.com/home-assistant/data.home-assistant/pull/83
You should upgrade all Docusaurus deps atomically in a single commit, not one then the other (ie Dependabot single deps upgrades won't work)

Still interested by the dev issue repro

The same errors occur when running npm run start btw.

@bethesque I am actually running your site, and the error I have in dev is not the same at all. I get a runtime console error:

image

If you look at your package lock on the deps upgrade commit you can see that there's still docusaurus core at alpha 61, that's probably the problem. All deps we provide should be set at the exact same level.

Will send a PR once I get your site working on alpha 62

@TomBrien can you tell me exactly how you got this error in dev?

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined

With which repo/branch/commit I can reproduce it?

Is it gone now or still there?

Thanks for the quick response and the PR @slorber 馃檹

image

We're getting these errors when we try the production build, not the dev. They are the same as the first comment. It broke our CI/CD. No errors occur when building the dev version.

@Idzikowski-Casey

Are you on latest version?
Are you using a monorepo?
Do you reproduce the error locally?
Do you have a repro that I can inspect (you can take your private site and remove anything sensitive until you have a minimal repro case)?

@slorber
Thanks for such a quick response and sorry I didn't see this till just now.
Our version was alpha.59 however the same error occurred when we upgraded to alpha.62. The error is occurring locally, but only on the production build, the dev image is building fine. We use Docker to containerize our app and our docusarus app resides within a directory in our overall project. I'll attach the link to the docusarus.config file and navigating to the rest of the app will be easy.

https://github.com/EarthCubeGeochron/Sparrow/blob/docs-for-master/docs/docusaurus.config.js

@Idzikowski-Casey I can't even run the branch on alpha 59 locally, is this normal?

NPM:

image

Yarn:

image

Also, this is not good, you should have the same version for all docusaurus core packages:

image

It would be much easier for me to find a solution if you had a working base branch, and failing deps upgrade PR. Try using Netlify, it's easy to setup and will simplify our life.

@slorber I think this issue you are having is due to not having the CLI for our project installed. The npm start command is configured to be sparrow docs-up once the command line is installed.

To do this, once the Sparrow is cloned run git submodule update --init
in the sparrow directory. Then run make install-dev.

Then try running sparrow docs-up on the docs-for-master branch. This command, the development version, is building fine. But the production build, sparrow docs-run, is where we are getting errors.

@Idzikowski-Casey unfortunately I don't have time to provide extensive help to everyone. If you want me to help solve this problem, please invest the time to remove your proprietary stuff from your project first and provide me with a regular Docusaurus project that I can simply run by cloning master and yarn install / yarn start. The ideal for me is to have a separate repo with a master deployment working on Netlify, and an upgrade PR that shows the netlify deployment failing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chandankumar4 picture chandankumar4  路  3Comments

lex111 picture lex111  路  3Comments

sebqq picture sebqq  路  3Comments

itelofilho picture itelofilho  路  3Comments

rickyvetter picture rickyvetter  路  3Comments