exhibitionist-digital / ultra

Zero-Legacy Deno/React Suspense SSR Framework

Home Page:https://ultrajs.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build react-router project: nested path routes like /table/countries are not supported in browser

d9k opened this issue · comments

      <Routes>
            <Route
              element={<TablePage />}
              path='table/:name'
            />
    </Routes>
deno task build
cd .ultra
deno task start

Then open https://localhost:8000/table/countries.

Result: multiple

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.

errors in browser.

Can't reproduce: minimal example works fine

https://github.com/d9k/d9k-problems-examples/tree/main/deno/ultra/291-nested-path-routes

Closing issue for now.

Reproduced on
https://github.com/d9k/d9k-problems-examples/tree/main/deno/ultra/291-nested-path-routes

Selection_2023-12-29_09-16-43

Added component with relative import:

import { useParams } from 'react-router-dom';
import { Spinner } from "../components/spinner.tsx";

function PageNestedDemo () {
  const name = useParams()['name'];

  return (
    <>
      <h1>Nested demo page</h1>

      <p>Url param :name value is "{name}"</p>

      <Spinner />
    </>
  );
}

export default PageNestedDemo;