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

fix(v2): fix redirect plugin when trailingSlash=false for .html extension #5102

Merged
merged 2 commits into from
Jun 30, 2021

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Jun 30, 2021

Motivation

Our prod can't deploy: https://app.netlify.com/sites/docusaurus-2/deploys/60dc4c6287cf5600078e2098

12:55:12 PM: Error: Redirect file creation error for "/opt/build/repo/website/build/__docusaurus/debug.html/index.html" path: Error: EEXIST: file already exists, mkdir '/opt/build/repo/website/build/__docusaurus/debug.html'.
12:55:12 PM: at writeRedirectFile (/opt/build/repo/packages/docusaurus-plugin-client-

We are trying to redirect path /debug.html to /debug

/debug.html is the content file for path /debug

The redirect file can't be:

  • /debug.html because it would override the original content file (we should never do that)
  • /debug.html/index.html because on Unix, it's not possible to create a folder with the same name as another file (the error we have here)

The only remaining solution to do this redirect locally remains to use this redirect filename: /debug.html.html (yes it looks weird)

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

test + prod deployment

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Jun 30, 2021
@slorber slorber requested a review from lex111 as a code owner June 30, 2021 15:06
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jun 30, 2021
@netlify
Copy link

netlify bot commented Jun 30, 2021

✔️ [V2]

🔨 Explore the source changes: 09fcb9b

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/60dc886c11cd65000890efca

😎 Browse the preview: https://deploy-preview-5102--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Jun 30, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 71
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-5102--docusaurus-2.netlify.app/

@github-actions
Copy link

github-actions bot commented Jun 30, 2021

Size Change: 0 B

Total Size: 635 kB

ℹ️ View Unchanged
Filename Size
website/build/assets/css/styles.********.css 87.7 kB
website/build/assets/js/main.********.js 445 kB
website/build/blog/2017/12/14/introducing-docusaurus/index.html 68.8 kB
website/build/docs/introduction/index.html 235 B
website/build/index.html 33.6 kB

compressed-size-action

@netlify
Copy link

netlify bot commented Jun 30, 2021

✔️ [V2]

🔨 Explore the source changes: 88d9d11

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/60dc88b6d9d17100070eae73

😎 Browse the preview: https://deploy-preview-5102--docusaurus-2.netlify.app

@slorber slorber merged commit 15a2b59 into master Jun 30, 2021
@slorber slorber deleted the slorber/redirect-plugin-fix-trailingSlash-false branch August 17, 2021 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants