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

Find a sustainable solution for dev server with non configurable historyApiFallback #91

Open
ia3andy opened this issue Jun 8, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@ia3andy
Copy link
Collaborator

ia3andy commented Jun 8, 2022

Currently, it is not possible to configure historyApiFallback on:

  • react-scripts start (from RCA).
  • ng dev
  • vite dev

Since Quinoa is relying on having a 404 when a file is not found, this is a problem.

For some reason, the library used by those servers for SPA routing is disabled when the Accept header is not provided (See https://www.npmjs.com/package/connect-history-api-fallback#htmlacceptheaders).

As a workaround, when making the request from Quinoa using the Vert.x Http Client, the Accept header is not set. With this the dev server honors 404:
https://github.com/quarkiverse/quarkus-quinoa/blob/main/runtime/src/main/java/io/quarkiverse/quinoa/QuinoaDevProxyHandler.java#L63

The best solution would be to have an environment to disable historyApiFallback but I've seen many issues asking for it without any resolution yet.

@ia3andy
Copy link
Collaborator Author

ia3andy commented Jun 8, 2022

cc @maxandersen (as discussed)

@ia3andy
Copy link
Collaborator Author

ia3andy commented Jun 8, 2022

I created this issue on CRA: facebook/create-react-app#12506

@ia3andy ia3andy changed the title Find a sustainable solution for React Create App (RCA) dev server Find a sustainable solution for dev server with non configurable historyApiFallback Jun 10, 2022
@melloware melloware added the enhancement New feature or request label Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants