I created a project on vite preact-typescript latest version , and installed preact-router , then when I tried to import Router, as in the example in Repo >>>>>>
this my code below
import Router from 'preact-router';import Home from './Home';import Guest from './Guest';
>>>>>>Could not find a declaration file for module 'preact-router'. 'c:/Users/user/Desktop/other/preact_1/node_modules/preact-router/dist/preact-router.mjs' implicitly has an 'any' type.
There are types at 'c:/Users/user/Desktop/other/preact_1/node_modules/preact-router/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'preact-router' library may need to update its package.json or typings
I created a project on vite preact-typescript latest version , and installed preact-router , then when I tried to import Router, as in the example in Repo >>>>>>
this my code below
import Router from 'preact-router';
import Home from './Home';
import Guest from './Guest';
export const App = () => {
return (
<>
<Router>
<Home path='/' />
<Guest path='guest' />
</Router>
</>
)
}
I got this response >>>>>>>>>
>>>>>>Could not find a declaration file for module 'preact-router'. 'c:/Users/user/Desktop/other/preact_1/node_modules/preact-router/dist/preact-router.mjs' implicitly has an 'any' type.
There are types at 'c:/Users/user/Desktop/other/preact_1/node_modules/preact-router/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'preact-router' library may need to update its package.json or typings