0

i try to upgrade my WebPart to SharePoint spfx 1.9.1, i follow recommandation generated by o365 spfx project upgrade --output md > report.md, but when i build my project i get two errors :

[16:10:57] Error - 'tsc' sub task errored after 322 ms 
 exited with code 1
[16:10:57] 'bundle' errored after 1.99 s
[16:10:57]
[16:10:57] Error - [tslint] error TS5023: Unknown compiler option 'extends'.
[16:10:57] Finished subtask 'tslint' after 621 ms
[16:10:57] ==================[ Finished ]==================
Error - 'tsc' sub task errored after 322 ms 
 exited with code 1
Error - [tslint] error TS5023: Unknown compiler option 'extends'.
[16:10:58] Project ls2-formation version:2.1.0
[16:10:58] Build tools version:3.8.8
[16:10:58] Node version:v10.16.3
[16:10:58] Total duration:5.12 s
[16:10:58] Task errors:2

I think it's caused by tslint.json :

{

  "extends": "@microsoft/sp-tslint-rules/base-tslint.json",
  "rules": {
    "class-name": false,
    "export-name": false,
    "forin": false,
    "label-position": false,
    "member-access": true,
    "no-arg": false,
    "no-console": false,
    "no-construct": false,
    "no-duplicate-variable": true,
    "no-eval": false,
    "no-function-expression": true,
    "no-internal-module": true,
    "no-shadowed-variable": true,
    "no-switch-case-fall-through": true,
    "no-unnecessary-semicolons": true,
    "no-unused-expression": true,
    "no-use-before-declare": true,
    "no-with-statement": true,
    "semicolon": true,
    "trailing-comma": false,
    "typedef": false,
    "typedef-whitespace": false,
    "use-named-parameter": true,
    "typeof-compare": true,
    "variable-name": false,
    "whitespace": false
  }

}
0

The error seems to be coming from the tsconfig.json file.

You need to ensure that the file is as below.

Notice, the extends attribute that is located above compilerOptions

{
  "extends": "./node_modules/@microsoft/rush-stack-compiler-2.9/includes/tsconfig-web.json",
  "compilerOptions": {
    "target": "es5",
    "forceConsistentCasingInFileNames": true,
    "module": "esnext",
    "moduleResolution": "node",
    "jsx": "react",
    "declaration": true,
    "sourceMap": true,
    "experimentalDecorators": true,
    "skipLibCheck": true,
    "outDir": "lib",
    "inlineSources": false,
    "strictNullChecks": false,
    "noUnusedLocals": false,
    "typeRoots": [
      "./node_modules/@types",
      "./node_modules/@microsoft"
    ],
    "types": [
      "es6-promise",
      "webpack-env"
    ],
    "lib": [
      "es5",
      "dom",
      "es2015.collection"
    ]
  },
  "include": [
    "src/**/*.ts"
  ],
  "exclude": [
    "node_modules",
    "lib"
  ]
}
  • it's work, thanks – khadi Sep 4 at 8:26

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.