I have a React / Mobex application written in TypeScript, built by Webpack 1. After updating TypeScript version from 2.3.4 to 2.4.2 i get an error
ERROR in C:\myproject\tsconfig.json
error TS2688: Cannot find type definition file for 'reflect-metadata'.
I also tried Typescript 2.7.2, same error. I've tried explicitly providing the path to its typings in "paths"
, tried installing the latest version of 'reflect-metadata'
, including globally - still same error.
tsconfig.json
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"jsx": "react",
"lib": ["dom", "es2015.promise", "es6"],
"module": "commonjs",
"moduleResolution": "node",
"noImplicitAny": true,
//"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": "./dist/",
"sourceMap": true,
"suppressImplicitAnyIndexErrors": true,
"target": "es5",
"types": ["reflect-metadata"],
"baseUrl": ".",
"paths": {
"react-split-pane": ["./type_fixes/react-split-pane/index.d.ts"],
"react-dropzone": ["./type_fixes/react-dropzone/index.d.ts"],
"react-bootstrap-toggle": ["./type_fixes/react-bootstrap-toggle/index.d.ts"]
}
},
"include": [
"./src/**/*",
"./index.tsx",
"./declarations.d.ts"
],
"exclude": [
"node_modules"
]
}
package.json
"dependencies": {
//...
"reflect-metadata": "0.1.10",
//...
},
"devDependencies": {
//...
"typescript": "2.4.2",
//...
},
"types": []
. – Control