react-router-typesafe-routes icon indicating copy to clipboard operation
react-router-typesafe-routes copied to clipboard

Error when bundling

Open ccapndave opened this issue 1 year ago • 2 comments

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.

ccapndave avatar Mar 29 '24 07:03 ccapndave

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?

ccapndave avatar Mar 29 '24 07:03 ccapndave

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

fenok avatar Mar 30 '24 11:03 fenok

Closing as non-actionable

fenok avatar Nov 23 '24 18:11 fenok