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

Autoredirect to 404 when custom page url is used #5497

Closed
5 tasks done
cristaloleg opened this issue Sep 7, 2021 · 3 comments
Closed
5 tasks done

Autoredirect to 404 when custom page url is used #5497

cristaloleg opened this issue Sep 7, 2021 · 3 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: question This issue is a user error/misunderstanding.

Comments

@cristaloleg
Copy link

cristaloleg commented Sep 7, 2021

🐛 Bug Report

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io
  • I have read the console error message carefully (if applicable)

Description

I have deployed Docusaurus at Cloudflare Pages (see https://flyer-flutter-docs.pages.dev/chat-ui/installation) and everything is fine. However, I also have tried to use it on our own domain with a simple redirection (via Cloudflare Workers, that's not so important) https://docs.flyer.chat/flutter/chat-ui/installation But sadly Docusaurus redirects me to 404.

Have you read the Contributing Guidelines on issues?

Yes.

Steps to reproduce

Use https://new.docusaurus.io to create a CodeSandbox reproducible demo of the bug.

(Write your steps here:)

  1. Open https://flyer-flutter-docs.pages.dev/chat-ui/installation - everything is fine
  2. Open https://docs.flyer.chat/flutter/chat-ui/installation - correct pages is opened and then redirection to 404 page.

Expected behavior

Expecting the same behaviour at https://flyer-flutter-docs.pages.dev/chat-ui/installation as at https://docs.flyer.chat/flutter/chat-ui/installation

Actual behavior

The returned page is correct, but then it redirects to 404 page. It's easy to see this redirect, just smash cmd+R to refresh the page.

Your environment

  • Public source code: not yet
  • Public site URL: https://flyer-flutter-docs.pages.dev/chat-ui/installation
  • Docusaurus version used: 2.0.0-beta.6
  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): Chrome 92.0.4515.159
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): macOS 10.15.6

Reproducible demo

Links are already mentioned above.

Note

Problem occurs with every page, chat-ui/installation is just the smallest page in our docs.

@cristaloleg cristaloleg 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 Sep 7, 2021
@cristaloleg
Copy link
Author

Part of docusaurus.config.js, everything else looks not so important.

module.exports = {
  title: 'Flyer Chat',
  tagline: 'Flyer Chat is a platform for creating in-app chat experiences using Flutter or React Native.',
  url: 'https://docs.flyer.chat',
  baseUrl: '/flutter',
  onBrokenLinks: 'throw',
  onBrokenMarkdownLinks: 'warn',
  favicon: 'img/favicon.ico',
  organizationName: 'flyerhq',
  projectName: 'flutter-flyer-chat'
  ...

@lex111
Copy link
Contributor

lex111 commented Sep 7, 2021

Does baseUrl field in config file of your site on custom domain contain trailing slash ('/flutter' -> '/flutter/')? Check whether this issue is reproduced on your local dev server?

@cristaloleg
Copy link
Author

Nice, my bad, have missed that build failed due to Error: "baseUrl" must be a string with a trailing slash.

https://docs.flyer.chat/flutter/chat-ui/installation already works fine
but https://flyer-flutter-docs.pages.dev/flutter/chat-ui/ is broken 'cause there is no /flutter prefix for assets, it's a separate problem and can be left as it is.

Thanks @lex111

@Josh-Cena Josh-Cena added closed: question This issue is a user error/misunderstanding. and removed status: needs triage This issue has not been triaged by maintainers labels Feb 21, 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 closed: question This issue is a user error/misunderstanding.
Projects
None yet
Development

No branches or pull requests

3 participants