question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error TS2304: Cannot find name 'PropertyKey'

See original GitHub issue

Version

2.13.0

Environment

Windows 10, Visual Studio Code,

Reproduction link

https://codepen.io/bva99/pen/XaQXgQ

Steps to reproduce

  1. Setup SharePoint Framework (React) project
  2. Add antd, npm install antd --save
  3. Add types npm install @types/antd -D
  4. Import DatePicker import { DatePicker } from "antd";
  5. 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:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
benjycuicommented, Sep 5, 2017

You had better provide a re-producible repo.

0reactions
afc163commented, Sep 12, 2017

Try upgrade @types/react to latest version and don’t use @types/antd.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found