create-react-app
create-react-app copied to clipboard
Could not find a declaration file for module 'history'
Windows 11 64bit
I just did a fresh install of this app and npm start threw the following error:

ERROR in src/index.tsx:4:38
TS7016: Could not find a declaration file for module 'history'. 'D:/Design und Development/epam react/my-app/node_modules/history/index.js' implicitly has an 'any' type.
If the 'history' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/history'
2 | import ReactDOM from 'react-dom';
3 | import { Router } from 'react-router-dom';
> 4 | import { createBrowserHistory } from 'history';
| ^^^^^^^^^
5 | import { ContextProvider } from '@epam/uui';
6 | import { Snackbar, Modals } from '@epam/uui-components';
7 | import { ErrorHandler } from '@epam/loveship';
I'm having the same problem
Try to install this version npm i @types/[email protected]
I ran into this problem as well. Seems like @ruslauz's solution works for me. But that feels like a workaround right? Is there a better way to solve this for the long term?
@ruslauz solutions works for me as well.