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

Cannot provide siteDir to external commands #9029

Closed
6 of 7 tasks
ouadie-lahdioui opened this issue May 31, 2023 · 1 comment
Closed
6 of 7 tasks

Cannot provide siteDir to external commands #9029

ouadie-lahdioui opened this issue May 31, 2023 · 1 comment
Labels
closed: duplicate This issue or pull request already exists in another issue or pull request

Comments

@ouadie-lahdioui
Copy link

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

Hi All,

All internal Docusaurus commands accept the siteDir parameter in addition to other options:

yar docusaurus serve [options] [siteDir]
yar docusaurus clear [options] [siteDir]
...

That provides the possibility to execute internal commands from another directory. For example, considering the following project organization:

my-app/
|-- package.json
|-- docs/
│  |-- docusaurus.config.js

Internal commands can be executed directly from my-app, for example: yarn docusaurus serve -p 8081 docs

Whats wrong?

I cannot execute external command docs:version directly from my-app

yarn docusaurus docs:version 1  --> ❌ Not working
yarn docusaurus docs:version 1 docs --> ❌ Not working
yarn docusaurus docs:version docs 1 --> ❌ Not working
yarn docusaurus docs:version 1 --config docs/docusaurus.config.js  --> ❌ Not working

Reproducible demo

No response

Steps to reproduce

  1. yarn install
  2. yarn docusaurus docs:version 1

Expected behavior

[SUCCESS] [docs]: version 1 created!

Actual behavior

[ERROR] No config file found.
[INFO] Expected one of:

  • docusaurus.config.js
  • docusaurus.config.cjs
    You can provide a custom config path with the --config option.
    /my-app/node_modules/@docusaurus/core/lib/server/config.js:25
    throw new Error();
    ^

Your environment

  • Docusaurus version used: 2.3.1
  • Environment name and version: Node v18
  • Operating system and version: MacOS Montery 12.3

Self-service

  • I'd be willing to fix this bug myself.
@ouadie-lahdioui ouadie-lahdioui 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 May 31, 2023
@Josh-Cena
Copy link
Collaborator

Duplicate of #8903

@Josh-Cena Josh-Cena marked this as a duplicate of #8903 May 31, 2023
@Josh-Cena Josh-Cena closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2023
@Josh-Cena Josh-Cena added closed: duplicate This issue or pull request already exists in another issue or pull request 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 May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: duplicate This issue or pull request already exists in another issue or pull request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants