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

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

Open
d9k opened this issue Dec 29, 2023 · 2 comments

Comments

@d9k
Copy link

d9k commented Dec 29, 2023

      <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.

@d9k
Copy link
Author

d9k commented Dec 29, 2023

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.

@d9k d9k closed this as completed Dec 29, 2023
@d9k
Copy link
Author

d9k commented Dec 29, 2023

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;

@d9k d9k reopened this Dec 29, 2023
d9k added a commit to d9k/citations-supabase-demo that referenced this issue Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant