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

Versioning a new doc is broken #450

Closed
JoelMarcey opened this issue Feb 14, 2018 · 0 comments
Closed

Versioning a new doc is broken #450

JoelMarcey opened this issue Feb 14, 2018 · 0 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@JoelMarcey
Copy link
Contributor

If you add a new doc to a versioned site, the new doc is not seen and an error is thrown.

Is this a bug report?

Yes.

Have you read the Contributing Guidelines?

Yes.

Environment

Docusaurus 1.0.6

(and confirmed it happens in Docusaurus 1.0.5)

Steps to Reproduce

  1. Have some docs in your docs folder
  2. npm run version 1.0.0
  3. Add a new doc to the docs folder
  4. npm run version 2.0.0

Expected Behavior

Version 2.0.0 is created.

Actual Behavior

Error: Document with id 'doc6' was requested but no document with that id could be located.
    at docVersion (/Users/joelm/dev/docusaurus-demo/website/node_modules/docusaurus/lib/server/versionFallback.js:136:11)
    at Object.diffLatestDoc (/Users/joelm/dev/docusaurus-demo/website/node_modules/docusaurus/lib/server/versionFallback.js:168:15)
    at files.forEach.file (/Users/joelm/dev/docusaurus-demo/website/node_modules/docusaurus/lib/version.js:92:24)
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/Users/joelm/dev/docusaurus-demo/website/node_modules/docusaurus/lib/version.js:69:7)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)

Reproducible Demo

See steps above.

@JoelMarcey JoelMarcey added bug An error in the Docusaurus core causing instability or issues with its execution showstopper labels Feb 14, 2018
JoelMarcey added a commit to JoelMarcey/Docusaurus that referenced this issue Feb 16, 2018
Instead of throwing, return `null` because that means we have a
new doc in our versioning sequence

(Also, cleaned up a bit of code as I researched this)

Fixes facebook#450
JoelMarcey added a commit that referenced this issue Feb 17, 2018
Instead of throwing, return `null` because that means we have a
new doc in our versioning sequence

(Also, cleaned up a bit of code as I researched this)

Partial Fix To #450
JoelMarcey added a commit to JoelMarcey/Docusaurus that referenced this issue Feb 17, 2018
Right now we were assuming that there would be no `-` in a version.
That was breaking things.

This allows more flexibility for versions like:

1.0.0-beta.2

Ref facebook#455
Fixes facebook#450
JoelMarcey added a commit that referenced this issue Feb 17, 2018
* Allow multiple `-` in a version string

Right now we were assuming that there would be no `-` in a version.
That was breaking things.

This allows more flexibility for versions like:

1.0.0-beta.2

Ref #455
Fixes #450

* Check more specific strings - need to look for the original_id
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

1 participant