7

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'.
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
  • This is great. One quick question, how I can check the version of typescript installed in my machine? – Mihir Jan 10 '18 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 :) – Gautam Sheth Jan 10 '18 at 16:45
  • Seems image is wrong. I am asking similar command as npm --version – Mihir Jan 10 '18 at 16:47
  • Currently spfx 1.4 uses Typescript 2.4.2 – Gautam Sheth Jan 10 '18 at 16:48
  • If typescript is installed globally, you can try npm -list -g --depth=0 – Gautam Sheth Jan 10 '18 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"
    ]
  }
}
  • 1
    what should we update tsconfig.json to ? What changes do we need to make ? – Nigel Price Jan 12 '18 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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