error TS2304: Cannot find name 'PropertyKey'
See original GitHub issueVersion
2.13.0
Environment
Windows 10, Visual Studio Code,
Reproduction link
https://codepen.io/bva99/pen/XaQXgQ
Steps to reproduce
- Setup SharePoint Framework (React) project
- Add antd,
npm install antd --save
- Add types
npm install @types/antd -D
- Import DatePicker
import { DatePicker } from "antd";
gulp serve
What is expected?
succesfull application compilation
What is actually happening?
[10:33:21] Error - typescript - node_modules\antd\lib\table\Table.d.ts(116,26): error TS2304: Cannot find name ‘PropertyKey’.
[10:33:21] Error - typescript - node_modules\antd\lib\table\Table.d.ts(119,32): error TS2304: Cannot find name ‘PropertyKey’.
package.json
"scripts": {
"build": "gulp bundle",
"clean": "gulp clean",
"test": "gulp test"
},
"dependencies": {
"@microsoft/sp-core-library": "~1.2.0",
"@microsoft/sp-webpart-base": "~1.2.0",
"@types/react": "15.0.38",
"@types/react-addons-shallow-compare": "0.14.17",
"@types/react-addons-test-utils": "0.14.15",
"@types/react-addons-update": "0.14.14",
"@types/react-dom": "0.14.18",
"@types/webpack-env": ">=1.12.1 <1.14.0",
"antd": "^2.13.0",
"office-ui-fabric-react": "^4.40.0",
"react": "15.4.2",
"react-dom": "15.4.2"
},
"devDependencies": {
"@microsoft/sp-build-web": "~1.2.0",
"@microsoft/sp-module-interfaces": "~1.2.0",
"@microsoft/sp-webpart-workbench": "~1.2.0",
"@types/antd": "^1.0.0",
"@types/chai": ">=3.4.34 <3.6.0",
"@types/mocha": ">=2.2.33 <2.6.0",
"gulp": "~3.9.1"
}
}
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"forceConsistentCasingInFileNames": true,
"allowSyntheticDefaultImports": true,
"module": "commonjs",
"jsx": "react",
"declaration": true,
"sourceMap": true,
"experimentalDecorators": true,
"types": [
"es6-promise",
"es6-collections",
"webpack-env"
]
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Cannot find name 'PropertyKey' - angular - Stack Overflow
ts error TS2339: Property 'for' does not exist on type 'SymbolConstructor'. I should have all my typings installed so I am not sure...
Read more >TS2304: Cannot find name 'PropertyKey'. · Issue #6874 - GitHub
And I am having issue when trying to add antd to the project. The text was updated successfully, but these errors were encountered: ......
Read more >Aws-nodejs-typescript — error TS2304: Cannot find name ...
Hi, I get the error error “error TS2304: Cannot find name 'PropertyKey'” after importing a class from external packages such as inversify.
Read more >TypeScript error TS2304 cannot find name require - Edureka
The error that I'm getting is the "TS2304: Cannot find name 'require' " when I attempt to transpile a simple TypeScript Node.js page....
Read more >probleme dans npm start angularJs2 - OpenClassrooms
node_modules/@types/core-js/index.d.ts( 353 , 48 ): error TS2304: Cannot find name 'PropertyKey' . node_modules/@types/core-js/index.d.ts( 354 , 52 ): error ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You had better provide a re-producible repo.
Try upgrade
@types/react
to latest version and don’t use@types/antd
.