question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docusaurus 2, cleanUrl false and deployment to google cloud

See original GitHub issue

In the migration guide you wrote that cleanUrl option is removed and it is true now by default. That means, all urls have no .html extension ending. And that is a big problem for us)

The problem, is that our documentation is deploying as a static assets to Google Cloud Storage (https://storage.googleapis.com …). That means, clean request cannot be redirected to dirty request, and after reloading any page we have this type of error:

<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Details>
No such object: ...
</Details>
</Error>

That happens because my-document-url is not the same object as my-document-url.html, from google’s point of view.

Is it possible to override cleanUrl to false somehow in docusaurus 2?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
amimascommented, Nov 28, 2019

I ran into a similar situation. I’m currently using V1 of Docusaurus and for deployment I use AWS services (S3 + CloudFront).

The problem is that when the static site assets are deployed to AWS S3 bucket, you’ll have to send a request for an exact path of an object (i.e. a file). It doesn’t work like a traditional web server where you’re automatically redirected to “index.html”.

In my case, I’ve setup a AWS Lambda function attached to AWS CloudFront. Before AWS CloudFront (a CDN) tries to fetch an object from AWS S3 storage, the Lambda function inspects the requested URL and changes it include “/index.html” at the end, if needed; basically tries to mimic a regular web server.

I haven’t dealt with Google Cloud yet, but I believe you can do something like this using Google Cloud Function. Pretty much all the cloud providers these days provides serverless functionality.

Hope that helps.

0reactions
amimascommented, Apr 14, 2020

@joeplaa glad you found a pointer to get started. In case it helps, you can also deploy the following directly from aws lambda. The concept is the same.

https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:621073008195:applications~standard-redirects-for-cloudfront

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deployment - Docusaurus
Deploying to Netlify​. To deploy your Docusaurus 2 sites to Netlify, first make sure the following options are properly configured: docusaurus.
Read more >
How to deploy a Docusaurus website to Google App Engine?
In your project root folder, create an app.yaml file with the following contents: # runtime could be anything, it won't create any instances ......
Read more >
Deploy Docusaurus 2 on GitHub pages - publishing it for free
How to deploy your Docusaurus 2 documentation website on GitHub pages in few simple steps for free. All you need to know!
Read more >
Observations from External Projects - GitHub Pages
Clear contributing guidelines makes it easy to figure out how to contribute effectively to the project. Clean project structure and code makes ...
Read more >
Assignment 3 - Mobile Cloud Application - CS3216
In recent years, mobile cloud computing has been one of the hottest ... differing amounts of hardware may be deployed to keep up...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found