8

I am trying to create a solution which will deploy the assets to SP online by following tutorial. Since this is based on version 1.4.0 i have udpated @microsoft-* packages to 1.4.0 But I am getting following error. I am not understanding how to make this packages sync.

Cannot find type definition file for 'es6-collections'.

2 Answers 2

4

This looks like a known issue while upgrading from SPFx 1.3 to 1.4

To fix it, just install the typed definitions of es6-collections as below:

npm install --save @types/es6-collections
5
  • This is great. One quick question, how I can check the version of typescript installed in my machine?
    – Mihir
    Commented Jan 10, 2018 at 16:39
  • Not really 100% sure, but if i open VS Code, its displayed at the bottom bar like this.. If it helped resolve your isse, can you please mark it answer :) Commented Jan 10, 2018 at 16:45
  • Seems image is wrong. I am asking similar command as npm --version
    – Mihir
    Commented Jan 10, 2018 at 16:47
  • 1
    Currently spfx 1.4 uses Typescript 2.4.2 Commented Jan 10, 2018 at 16:48
  • If typescript is installed globally, you can try npm -list -g --depth=0 Commented Jan 10, 2018 at 16:55
2

Please update your tsconfig.json (in the root of the project). The latest yeoman generator creates it like this:

{
  "compilerOptions": {
    "target": "es5",
    "forceConsistentCasingInFileNames": true,
    "module": "commonjs",
    "jsx": "react",
    "declaration": true,
    "sourceMap": true,
    "experimentalDecorators": true,
    "skipLibCheck": true,
    "typeRoots": [
      "./node_modules/@types",
      "./node_modules/@microsoft"
    ],
    "types": [
      "es6-promise",
      "webpack-env"
    ],
    "lib": [
      "es5",
      "dom",
      "es2015.collection"
    ]
  }
}
2
  • 2
    what should we update tsconfig.json to ? What changes do we need to make ? Commented Jan 12, 2018 at 13:55
  • you should add es6 to lib section at the top
    – kesava
    Commented Sep 1, 2020 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.