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

[BUG] 404 Error in prod but works in dev mode #6647

Open
onrdmr opened this issue Jan 14, 2025 · 3 comments
Open

[BUG] 404 Error in prod but works in dev mode #6647

onrdmr opened this issue Jan 14, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@onrdmr
Copy link

onrdmr commented Jan 14, 2025

Describe the bug

image

I have 404 not found error when i was routing. I could all routing correctly in dev mode bu i create docker container, I don't go that paths.

Steps To Reproduce

  1. Docker run on three different DockerFile option.
  2. Login Correctly,
  3. In page forwards are Ok.
  4. When i refresh page, it gives 404 not found.

Expected behavior

Render the correct page not give 404 not found page

Packages

@react-router-dom

Additional Context

No response

@onrdmr onrdmr added the bug Something isn't working label Jan 14, 2025
@alicanerdurmaz alicanerdurmaz changed the title [BUG] [BUG] 404 Error in Production but works in dev mode Jan 15, 2025
@alicanerdurmaz alicanerdurmaz changed the title [BUG] 404 Error in Production but works in dev mode [BUG] 404 Error in prod but works in dev mode Jan 15, 2025
@alicanerdurmaz
Copy link
Member

Hello @onrdmr, we need more details to debug this issue. Could you provide a reproducible example?

@onrdmr
Copy link
Author

onrdmr commented Jan 15, 2025

Hi Alican, I cannot share reproducible example now. But i think, it is about server side rendering issue like gituhb pages
https://stackoverflow.com/a/73302075.
I have followed this link and change my BrowserRoute to HashRoute but i am getting "Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec." this error with nothing on page.
What are the best practice serve refine dev project for production envrionment in ubuntu server. By the way, this was happened switching my internal routing to nginx to apache, which they uses proxypass on container.

@alicanerdurmaz
Copy link
Member

Deploying Refine works the same way as deploying any other React app, because Refine uses React’s Context API for its features. But, platform you choose to use with Refine can have diffrences. For example, using Vite with React Router might require different environments and configurations compared to Next.js.

I don’t think this issue is caused by Refine, but I asked for a reproducible example just to be sure. There can be many different configurations when deploying an application. For example, we deploy our examples to Netlify, and Netlify requires extra configuration, as seen here:
https://github.com/refinedev/refine/blob/main/examples/pixels/netlify.toml

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

No branches or pull requests

2 participants