0

I had 2 webparts in my solution. But when i tried to add the 3rd webpart, it successfully adds. But after that "gulp serve" fails. Below is the error message

D:\Bloom\Code\BloomWebparts>gulp serve

Build target: DEBUG

D:\Bloom\Code\BloomWebparts\node_modules\@microsoft\sp-build-web\node_modules\@m icrosoft\node-core-library\lib\JsonSchema.js:178 throw new Error(prefix + os.EOL + ^

Error: JSON validation failed: D:\Bloom\Code\BloomWebparts\config\tslint.json

Error: #/ (Defines configuration options for the...) Additional properties not allowed: lintConfig,useDefaultConfigAsBase,remo veExistingRules,displayAsWarning at validateObjectWithCallback (D:\Bloom\Code\BloomWebparts\node_modules\@mic rosoft\sp-build-web\node_modules\@microsoft\node-core-library\lib\JsonSchema.js: 178:19) at JsonSchema.validateObjectWithCallback (D:\Bloom\Code\BloomWebparts\node_m odules\@microsoft\sp-build-web\node_modules\@microsoft\node-core-library\lib\Jso nSchema.js:193:13) at JsonSchema.validateObject (D:\Bloom\Code\BloomWebparts\node_modules\@micr osoft\sp-build-web\node_modules\@microsoft\node-core-library\lib\JsonSchema.js:1 75:14) at TslintCmdTask._readConfigFile (D:\Bloom\Code\BloomWebparts\node_modules\@ microsoft\sp-build-web\node_modules\@microsoft\gulp-core-build\lib\tasks\GulpTas k.js:308:28) at TslintCmdTask.onRegister (D:\Bloom\Code\BloomWebparts\node_modules\@micro soft\sp-build-web\node_modules\@microsoft\gulp-core-build\lib\tasks\GulpTask.js: 87:32) at Object.initialize (D:\Bloom\Code\BloomWebparts\node_modules\@microsoft\sp -build-web\node_modules\@microsoft\gulp-core-build\lib\index.js:299:24) at SPWebBuildRig.initialize (D:\Bloom\Code\BloomWebparts\node_modules\@micro soft\sp-build-web\node_modules\@microsoft\sp-build-common\lib\BuildRig.js:61:19)

at SPWebBuildRig.initialize (D:\Bloom\Code\BloomWebparts\node_modules\@micro

soft\sp-build-web\node_modules\@microsoft\sp-build-common\lib\SPBuildRig.js:22:1 5) at SPWebBuildRig.initialize (D:\Bloom\Code\BloomWebparts\node_modules\@micro soft\sp-build-web\lib\SPWebBuildRig.js:15:15) at Object.exports.initialize (D:\Bloom\Code\BloomWebparts\node_modules\@micr osoft\sp-build-web\lib\index.js:23:17) at Object. (D:\Bloom\Code\BloomWebparts\gulpfile.js:7:7) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3)

D:\Bloom\Code\BloomWebparts>

Any idea why this happens?

1 Answer 1

1

It looks like your tslint.json file was modified unexpectedly.

You can try to save your tslint.json before adding the third web part. Then add it and restore original tslint.json.

11
  • Thanks for the reply Sergei. But I have already tried that. Same solution works fine in my colleague's environment. He is able to add new webparts and build it without issue. I took his tslint file and tried that also.. No luck. I tried creating a new solution and used that tslint.json. Same issue exists
    – CHANDRU D
    Commented Sep 14, 2018 at 12:23
  • Hmm.. in that case for me it looks like a version issue. Have you updated your SPFx generator recently? Commented Sep 14, 2018 at 12:41
  • I don't think so. But I am new to SPFx. So maybe I would have done something without actually knowing it.. Anyway to confirm it , in package.json i have this - "@microsoft/generator-sharepoint": "^1.6.0",
    – CHANDRU D
    Commented Sep 14, 2018 at 12:48
  • Did your two previous webparts were created with 1.6 version? Commented Sep 14, 2018 at 12:50
  • I created those 2 webparts a week back. But I am not sure about the version. any way to find that?
    – CHANDRU D
    Commented Sep 14, 2018 at 12:53

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.