Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Build breaks with "trailingSlash: false" #52

Closed
sdirix opened this issue Jul 23, 2021 · 4 comments
Closed

Build breaks with "trailingSlash: false" #52

sdirix opened this issue Jul 23, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@sdirix
Copy link

sdirix commented Jul 23, 2021

Bug description

Hi! Recently the Docusaurus team introduced a new configuration option trailingSlash: boolean | undefined, see here.

When specifying trailingSlash: false and using "@cmfcmf/docusaurus-search-local": "^0.6.2" the Docusaurus build breaks.

Reproduction

Add trailingSlash: false to the Docusaurus config

Error message:

[Local Search] [INFO]: Gathering documents
[Local Search] [INFO]: Parsing documents
[Local Search] [DEBUG]: Parsing blog file /build/blog/hello-world/index.html (url: /blog/hello-world)
[Local Search] [DEBUG]: Parsing blog file /build/blog/hola/index.html (url: /blog/hola)
[Local Search] [DEBUG]: Parsing blog file /build/blog/welcome/index.html (url: /blog/welcome)
[Local Search] [DEBUG]: Parsing docs file /build/docs/intro/index.html (url: /docs/intro)
[Local Search] [DEBUG]: Parsing docs file /build/docs/tutorial-basics/congratulations/index.html (url: /docs/tutorial-basics/congratulations)
[Local Search] [DEBUG]: Parsing docs file /build/docs/tutorial-basics/create-a-blog-post/index.html (url: /docs/tutorial-basics/create-a-blog-post)
[Local Search] [DEBUG]: Parsing docs file /build/docs/tutorial-basics/create-a-document/index.html (url: /docs/tutorial-basics/create-a-document)
[Local Search] [DEBUG]: Parsing docs file /build/docs/tutorial-basics/create-a-page/index.html (url: /docs/tutorial-basics/create-a-page)
[Local Search] [DEBUG]: Parsing docs file /build/docs/tutorial-basics/deploy-your-site/index.html (url: /docs/tutorial-basics/deploy-your-site)
[Local Search] [DEBUG]: Parsing docs file /build/docs/tutorial-basics/markdown-features/index.html (url: /docs/tutorial-basics/markdown-features)
[Local Search] [DEBUG]: Parsing docs file /build/docs/tutorial-extras/manage-docs-versions/index.html (url: /docs/tutorial-extras/manage-docs-versions)
[Local Search] [DEBUG]: Parsing docs file /build/docs/tutorial-extras/translate-your-site/index.html (url: /docs/tutorial-extras/translate-your-site)
Unable to build website for locale "en".
Error: ENOENT: no such file or directory, open '/build/blog/hello-world/index.html'
error Command failed with exit code 1.

You can reproduce the issue on this branch.

Environment

Package Versions

├─ @cmfcmf/docusaurus-search-local@0.6.2
├─ @docusaurus/core@2.0.0-beta.3
├─ @docusaurus/cssnano-preset@2.0.0-beta.3
├─ @docusaurus/mdx-loader@2.0.0-beta.3
├─ @docusaurus/plugin-content-blog@2.0.0-beta.3
├─ @docusaurus/plugin-content-docs@2.0.0-beta.3
├─ @docusaurus/plugin-content-pages@2.0.0-beta.3
├─ @docusaurus/plugin-debug@2.0.0-beta.3
├─ @docusaurus/plugin-google-analytics@2.0.0-beta.3
├─ @docusaurus/plugin-google-gtag@2.0.0-beta.3
├─ @docusaurus/plugin-sitemap@2.0.0-beta.3
├─ @docusaurus/preset-classic@2.0.0-beta.3
├─ @docusaurus/react-loadable@5.5.0
├─ @docusaurus/theme-classic@2.0.0-beta.3
├─ @docusaurus/theme-common@2.0.0-beta.3
├─ @docusaurus/theme-search-algolia@2.0.0-beta.3
├─ @docusaurus/types@2.0.0-beta.3
├─ @docusaurus/utils-common@2.0.0-beta.3
├─ @docusaurus/utils-validation@2.0.0-beta.3
└─ @docusaurus/utils@2.0.0-beta.3

Node Version

  • node -v: v12.22.1

Docusaurus Environment

  • Are you using a custom theme? No
  • Paste the plugin config of the local search plugin from your docusaurus.config.js file: Default

Additional context

@sdirix sdirix added the bug Something isn't working label Jul 23, 2021
@cmfcmf cmfcmf closed this as completed in 6a42c00 Jul 24, 2021
@cmfcmf
Copy link
Owner

cmfcmf commented Jul 24, 2021

Thank you for bringing this up! I have released a fix as part of 0.6.3.

@marcelmerkx
Copy link

marcelmerkx commented Dec 14, 2021

hi @cmfcmf , could it be this issue regressed?

trailingSlash=false :

Unable to build website for locale "en".
Error: ENOENT: no such file or directory, open 'C:\Users\ABCD\Documents\Development\ABCXYZ-dev-docs\build\.html'
error Command failed with exit code 1.

trailingSlash=true --> works like a charm!

@cmfcmf cmfcmf reopened this Dec 14, 2021
cmfcmf added a commit that referenced this issue Dec 14, 2021
cmfcmf added a commit that referenced this issue Dec 14, 2021
@cmfcmf cmfcmf closed this as completed in 371d60a Dec 14, 2021
@cmfcmf
Copy link
Owner

cmfcmf commented Dec 14, 2021

hi @cmfcmf , could it be this issue regressed?

You're right! I fixed it again, and this time I also added example docs with trailingSlash: false to CI, so that it will hopefully not come up again. I will release v0.9.2 with this fix shortly.

@marcelmerkx
Copy link

@cmfcmf thanks Christian, awesome speed for fixing. totally works!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants