react-router-typesafe-routes
react-router-typesafe-routes copied to clipboard
Error when bundling
Hi! I've just found this wonderful looking project and would love to use it in one of my project. However, when I bundle my project I get these errors. Any ideas?
✘ [ERROR] No matching export in "node_modules/react-router-dom/esm/react-router-dom.js" for import "useSearchParams"
node_modules/react-router-typesafe-routes/dom/useTypedSearchParams.js:12:9:
12 │ import { useSearchParams, createSearchParams } from "react-router-dom";
╵ ~~~~~~~~~~~~~~~
✘ [ERROR] No matching export in "node_modules/react-router-dom/esm/react-router-dom.js" for import "createSearchParams"
node_modules/react-router-typesafe-routes/dom/useTypedSearchParams.js:12:26:
12 │ import { useSearchParams, createSearchParams } from "react-router-dom";
╵ ~~~~~~~~~~~~~~~~~~
✘ [ERROR] No matching export in "node_modules/react-router-dom/esm/react-router-dom.js" for import "createSearchParams"
node_modules/react-router-typesafe-routes/dom/route.js:1:9:
1 │ import { createSearchParams, generatePath } from "react-router-dom";
╵ ~~~~~~~~~~~~~~~~~~
Please let me know if there is any more information I can provide to help debug this.
Ah, I see that the problem is probably that my project uses React Router v5 instead of v6. Unfortunately I am forced into this by Ionic, which only supports v5. Is there any way I can still use the library?
Hi! Unfortunately, the current version of the library is only compatible with v6, which significantly differs from v5.
There is an old version that is compatible with v5, but it's quite different and not supported anymore: https://www.npmjs.com/package/react-router-typesafe-routes/v/0.3.2
Closing as non-actionable