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]: only '/' is working created by createBrowserRouter, other is 404 #11346

Closed
ilhamsj opened this issue Mar 14, 2024 · 1 comment
Closed

Comments

@ilhamsj
Copy link

ilhamsj commented Mar 14, 2024

What version of React Router are you using?

6.22.3

Steps to Reproduce

import * as React from 'react'
import ReactDom from 'react-dom/client'
import { createBrowserRouter, RouterProvider } from 'react-router-dom'

const router = createBrowserRouter([
  {
    path: '/',
    element: <div> welcome </div>,
  },
  {
    path: 'test',
    element: <div> test </div>
  }
])

ReactDom.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <RouterProvider router={router} />
  </React.StrictMode>
)

Expected Behavior

can access /test in local
Screenshot 2024-03-14 at 23 14 24

Actual Behavior

404 in vercel
https://react-router-v6-fyet8yqu3-jadesnowman.vercel.app/test

@ilhamsj ilhamsj added the bug label Mar 14, 2024
Copy link
Contributor

👋 @ilhamsj, we use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request.
For usage questions, please use Stack Overflow or Discord where there are a lot more people ready to help you out, or post a new question in the Discussions tab of this repository.
Please feel free to clarify your issue if you think it was closed prematurely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants