Closed
Description
What version of React Router are you using?
6.16.0
Steps to Reproduce
pnpm init
echo "hoist=false" >.npmrc
pnpm i react react-dom react-router-dom@5 react-router-dom-v5-compat typescript
tsconfig.json:
{
"compilerOptions": {
"lib": ["es2018", "dom"],
}
}
index.ts:
import { CompatRouter } from "react-router-dom-v5-compat"
Run pnpm tsc
.
Expected Behavior
pnpm tsc
runs without errors.
Actual Behavior
node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/react-router-dom-v5-compat/dist/react-router-dom/dom.d.ts:1:71 - error TS2307: Cannot find module '@remix-run/router' or its corresponding type declarations.
1 import type { FormEncType, HTMLFormMethod, RelativeRoutingType } from "@remix-run/router";
~~~~~~~~~~~~~~~~~~~
node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/react-router-dom-v5-compat/dist/react-router-dom/index.d.ts:7:203 - error TS2307: Cannot find module '@remix-run/router' or its corresponding type declarations.
7 import type { Fetcher, FormEncType, FormMethod, FutureConfig as RouterFutureConfig, GetScrollRestorationKeyFunction, History, HTMLFormMethod, HydrationState, Router as RemixRouter, V7_FormMethod } from "@remix-run/router";
~~~~~~~~~~~~~~~~~~~
Found 2 errors in 2 files.