web-infra-dev / rspack

A fast Rust-based web bundler 🦀️

Home Page:https://rspack.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: react-router-dom cannot configure nested routers of 3 levels or more

nguyenbatranvan opened this issue · comments

System Info

MacOs M1

Details

With react router dom when I configure from nesting router 2 levels or less. Everything still works normally. To my surprise, When I configured to the 3rd level, an error appeared:
image

image

I copied all the files and worked with vite, everything works fine with my current config!! Is there a problem with the router?

Reproduce link

https://github.com/nguyenbatranvan/rspack-turbo-mdf

Reproduce Steps

  1. pnpm i
  2. pnpm run remote
  3. goto http://localhost:3000/nested-1 -> Working
  4. goto http://localhost:3000/nested-1/1 -> show error above

The problem occurs due to the publicPath='auto' configuration. If I specify publicPath='http://localhost:3000' the problem is resolved. Is there any way to automatically get publicPath according to window.location.origin?