hookrouter icon indicating copy to clipboard operation
hookrouter copied to clipboard

Import returning error "is not a module" when try to use hookrouter with CRA + typescript

Open jrmarqueshd opened this issue 3 years ago • 2 comments

Hello Devs.

To the owner repo or who wants to help him

I'm catch error when a import this module in my app component.

[App.tsx] image

this is my package.json

[package.json] image

For developers who want to solve the problem superficially until the owner of the repo solves it

I managed to fix this error by migrating the route config to a file called routes.js, it seems that the problem happens only in tsx | ts extensions!

after migrating the route settings, it looked like this:

[routes.js] image

and in my App.tsx file, it looked like this:

[App.tsx] image

I hope I have helped in some way. 😄

jrmarqueshd avatar Apr 21 '21 21:04 jrmarqueshd

See #147 for another workaround.

jordanmack avatar May 21 '21 07:05 jordanmack

Or downgrade from 1.2.5 to 1.2.3.

a613 avatar Dec 21 '21 20:12 a613