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

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

Closed
bethesque opened this issue Aug 30, 2020 · 15 comments · Fixed by pact-foundation/docs.pact.io#27
Labels
closed: question This issue is a user error/misunderstanding.

Comments

@bethesque
Copy link

bethesque commented Aug 30, 2020

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 pact-foundation/docs.pact.io@e650d27

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

git clone git@github.com: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.

@bethesque bethesque 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 30, 2020
@slorber
Copy link
Collaborator

slorber commented Aug 30, 2020

Hi,

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

@bethesque
Copy link
Author

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.

@TomBrien
Copy link
Contributor

TomBrien commented Aug 31, 2020

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

@slorber
Copy link
Collaborator

slorber commented Aug 31, 2020

@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: home-assistant/data.home-assistant#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

@bethesque
Copy link
Author

The same errors occur when running npm run start btw.

@slorber
Copy link
Collaborator

slorber commented Aug 31, 2020

@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

@slorber
Copy link
Collaborator

slorber commented Aug 31, 2020

PR is there: pact-foundation/docs.pact.io#27

I've opened some new related issues btw:

#3371
#3370

@slorber slorber closed this as completed Aug 31, 2020
@slorber
Copy link
Collaborator

slorber commented Aug 31, 2020

@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?

@bethesque
Copy link
Author

Thanks for the quick response and the PR @slorber 🙏

@Idzikowski-Casey
Copy link

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.

@slorber
Copy link
Collaborator

slorber commented Oct 21, 2020

@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)?

@Idzikowski-Casey
Copy link

@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

@slorber
Copy link
Collaborator

slorber commented Oct 26, 2020

@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.

@Idzikowski-Casey
Copy link

@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.

@slorber
Copy link
Collaborator

slorber commented Oct 27, 2020

@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.

@Josh-Cena Josh-Cena added closed: question This issue is a user error/misunderstanding. and removed 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 Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: question This issue is a user error/misunderstanding.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants