-
Notifications
You must be signed in to change notification settings - Fork 12.8k
npm install @types/react-router
#9488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have the same issue with the |
I don't think the problem is with |
The |
Looks like the types-publisher does not scan for .d.ts in subfolders. |
How can I get this fix? I've installed |
I am having the same problem:
|
@Andy-MS can you see what's going on? |
This is marked as fixed, but I still get these compilation errors with using the latest react-router typescript definitions when using npm install @types/react-router --save |
c:\test\9488>npm install @types/react-router
[email protected] c:\test\9488
`-- @types/[email protected]
+-- @types/[email protected]
`-- @types/[email protected]
c:\test\9488>echo import { History } from 'react-router'; > index.ts
c:\test\9488>tsc --v
Version 2.1.4
c:\test\9488>tsc --init
c:\test\9488>tsc
c:\test\9488>echo %ERRORLEVEL%
0 |
As detailed by this post, it only works if module resolution is set to node in tsconfig. DefinitelyTyped/DefinitelyTyped#10686. I was able to get around this by manually changing the imports of "history" to the relative path of the @types/history index definition |
the resolution of these packages assumes a node-style resolution. so you need to use |
We use AMD and therefore cannot use node module resolution. TypeScript definitions should be robust enough to handle all module types. Can we re-open this? |
The other issue that you linked to is still open and we're planning to fix it. |
There is a bug in
typings
http://stackoverflow.com/questions/38157103/dtreact-router-error-ts2503-cannot-find-namespace-historymodule so I thought I'd give@types
a go. However that didn't do a stellar job either.Errors:
Where should people put
@types
issues? 🌹The text was updated successfully, but these errors were encountered: