I'm following the tutorial at https://marmelab.com/react-admin/Tutorial.html and have hit an error. My project is using Typescript.
TypeScript error in /home/foo/bar/node_modules/ra-core/esm/controller/field/index.d.ts(10,1):
Declaration or statement expected. TS1128
8 | export declare type ReferenceArrayProps = ListControllerProps;
9 | export declare type ReferenceManyProps = ListControllerProps;
> 10 | export type { LinkToType };
| ^
11 | export { useReferenceArrayFieldController, ReferenceArrayFieldController, ReferenceFieldController, getResourceLinkPath, useReferenceManyFieldController, ReferenceManyFieldController, };
12 |
I have tried the solutions mentioned here but I still have the error.
My dependencies are:
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"@types/jest": "^24.9.1",
"@types/node": "^12.12.58",
"@types/react": "^16.9.49",
"@types/react-dom": "^16.9.8",
"prop-types": "^15.7.2",
"ra-data-json-server": "^3.8.4",
"react": "^16.13.1",
"react-admin": "^3.8.4",
"react-dom": "^16.13.1",
"react-scripts": "3.4.3",
"typescript": "^3.7.5"
I have faced this issue today too. I done 2 things:
yarn add [email protected]
// @ts-ignore
import { Admin, Resource } from 'react-admin';
Thanks for the pointer. Upgrading to Typescript 4.0 fixed the compilation error.
Most helpful comment
I have faced this issue today too. I done 2 things: