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

In plugin-content-docs, when path contains a dash, anything after the dash is dropped #3801

Closed
vjpr opened this issue Nov 23, 2020 · 3 comments · Fixed by #3970
Closed

In plugin-content-docs, when path contains a dash, anything after the dash is dropped #3801

vjpr opened this issue Nov 23, 2020 · 3 comments · Fixed by #3970
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@vjpr
Copy link

vjpr commented Nov 23, 2020

🐛 Bug Report

From: #2528 (comment)

   [
      '@docusaurus/plugin-content-docs',
      {
        id: 'foo-bar',
        path: 'foo-bar',
        routeBasePath: 'foo-bar',
      }
   ]

But it errors while looking inside default:
docs/.docusaurus/docusaurus-plugin-content-docs/default/site-community-doc-1-md-87a.json

...but the file is in community instead:

docs/.docusaurus/docusaurus-plugin-content-docs/community/site-community-doc-1-md-87a.json

Have you read the Contributing Guidelines on issues?

Yes.

To Reproduce

(Write your steps here:)

Add plugin as follows:

   [
      '@docusaurus/plugin-content-docs',
      {
        id: 'foo-bar',
        path: 'foo-bar',
        routeBasePath: 'foo-bar',
      }
   ]

It will error when rendering this page.

Expected behavior

No error.

(Write what you thought would happen.)

Actual Behavior

ENOENT error.

Your Environment

  • Docusaurus version used: 2
  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0):
  • Operating system and version (desktop or mobile): desktop

Reproducible Demo

TODO

@vjpr vjpr 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 Nov 23, 2020
@slorber
Copy link
Collaborator

slorber commented Nov 23, 2020

Thanks @vjpr
Can you give me more details about the error you see?
You probably have more output than just ENOENT?
How have you figured this error out?

I'm able reproduce something locally, by using a - in the path of our own website, but I don't see the same error as you.

image

I am unable to run yarn start due to this error:

image

But I'm able to run yarn build

Will try to resolve my bug, but still need to figure out a repro for yours if it's different.

@tomchen
Copy link

tomchen commented Nov 25, 2020

Is it related to #3818 that I've just posted?

I've tried some id, path and routeBasePath of docs, what I understand is:

  • id is tested against /^[a-zA-Z_\-]+$/ (letters, -, _ allowed but no numbers)
  • path can contain letters, numbers, -, _. But, there is issue Conflict of docs's paths #3818
  • routeBasePath can contain letters, numbers, -, _, no issues

I don't see path: 'foo-bar' alone could raise problems.

@slorber
Copy link
Collaborator

slorber commented Dec 30, 2020

I think this is solved by #3970, but let me know if this is not the case

@Josh-Cena Josh-Cena removed the status: needs triage This issue has not been triaged by maintainers label Mar 19, 2022
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
4 participants