Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Object.entries() - Failed to compile: Property 'entries' does not exist on type 'ObjectConstructor'. #245

Open
webmato opened this issue Dec 13, 2018 · 2 comments

Comments

@webmato
Copy link

webmato commented Dec 13, 2018

At first I had added parameter "lib":"es2017" into tsconfig.json file.
Now TS in WebStorm doesn't complain anymore and autocomplete is even suggesting Object.entries() method, but in the end compiling fails with following error message:

Compiling...
Failed to compile.
  ...
(73,43): Property 'entries' does not exist on type 'ObjectConstructor'.

Configuration of ejected TS create-react-app:

tsconfig.json:

{
  "compilerOptions": {
    "baseUrl": ".",
    "outDir": "build/dist",
    "module": "esnext",
    "target": "es6",
    "lib": [
      "es2015",
      "es2016",
      "es2017",
      "es2018",
      "dom"
    ],
    "sourceMap": true,
    "allowJs": true,
    "jsx": "react",
    "moduleResolution": "node",
    "rootDir": "src",
    "forceConsistentCasingInFileNames": true,
    "noImplicitReturns": true,
    "noImplicitThis": true,
    "noImplicitAny": true,
    "importHelpers": true,
    "strictNullChecks": true,
    "suppressImplicitAnyIndexErrors": true,
    "noUnusedLocals": true
  },
  "exclude": [
    "node_modules",
    "build",
    "scripts",
    "acceptance-tests",
    "webpack",
    "jest",
    "src/setupTests.ts"
  ]
}

package.json:

  "devDependencies": {
    "@types/jest": "^23.3.10",
    "@types/node": "^10.12.12",
    "@types/react": "^16.7.13",
    "@types/react-dom": "^16.0.11",
    "typescript": "^3.2.1"
  },
"dependencies": {
    "autoprefixer": "7.1.6",
    "babel-jest": "20.0.3",
    "babel-loader": "7.1.2",
    "babel-preset-react-app": "^3.1.2",
    "case-sensitive-paths-webpack-plugin": "2.1.1",
    "chalk": "1.1.3",
    "css-loader": "0.28.7",
    "dotenv": "4.0.0",
    "dotenv-expand": "4.2.0",
    "extract-text-webpack-plugin": "3.0.2",
    "file-loader": "1.1.5",
    "fork-ts-checker-webpack-plugin": "^0.2.8",
    "fs-extra": "3.0.1",
    "html-webpack-plugin": "2.29.0",
    "jest": "20.0.4",
    "object-assign": "4.1.1",
    "postcss-flexbugs-fixes": "3.2.0",
    "postcss-loader": "2.0.8",
    "promise": "8.0.1",
    "prop-types": "^15.6.2",
    "raf": "3.4.0",
    "react": "^16.6.3",
    "react-dev-utils": "^5.0.2",
    "react-dom": "^16.6.3",
    "resolve": "1.6.0",
    "source-map-loader": "^0.2.1",
    "style-loader": "0.19.0",
    "sw-precache-webpack-plugin": "0.11.4",
    "ts-jest": "22.0.1",
    "ts-loader": "^2.3.7",
    "tsconfig-paths-webpack-plugin": "^2.0.0",
    "tslint": "^5.7.0",
    "tslint-config-prettier": "^1.10.0",
    "tslint-react": "^3.2.0",
    "uglifyjs-webpack-plugin": "1.2.5",
    "url-loader": "0.6.2",
    "webpack": "3.8.1",
    "webpack-dev-server": "2.11.3",
    "webpack-manifest-plugin": "1.3.2",
    "whatwg-fetch": "2.0.3"
  },
@FreemenL
Copy link

Is it solved?

@web1992
Copy link

web1992 commented Dec 18, 2018

see #240

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants