Issue with Gulp-build for newly added webpart
Expected or Desired Behavior
i execute gulp-build for the SPfx project that i have created and i expect it to build successfully
Observed Behavior
Gulp-build executes for couple of minutes and throws error
Error - 'tslint' sub task errored after 1.16 s FatalError in plugin 'gulp-cache' Message:
Invalid source file: C:/myproject/src/webparts/estimate/EstimateWebPart.d.ts. Ensure that the files supplied to lint have a .ts, .tsx, .d.ts, .js or .jsx extension.
Details: innerError: undefined

Steps to Reproduce
Create a new SPFX react webpart project Open the project in visual studio code open the powershell console in the visual studio code or open node command prompt enter gulp build/ gulp bundle/gulp serve the build process errors out
Environment Version Details
microsoft/[email protected] +-- [email protected] +-- [email protected] +-- [email protected] `-- [email protected]
@nickpape-msft for more background on TSLint.
Does that file exist? It's a little unusual to have a *.D.TS file in your src directory. Should it be referenced as a typeRoot in your tsconfig.json instead?
Yes, the file does exist in the path specified in the error and this file is auto generated with the template.
What template engine is autogenerating it?
Hello, I am having exact same issue, .d.ts file exists and seems to be ok.
I generated the webpart using yeoman and without editing anything it throws this error.
Tested the whole process again and it works now, so possibly some glitch happened during the installation of packages (gulp-cache is the package that threw the error).
It sounds like this isn't a problem anymore, so I'm going to close this issue. If you see this again, feel free to reopen this.
Just adding some additional info. This was caused by having declaration: true in the tsconfig.json . No action required, but incase someone else runs into it. I saw this after playing around with tsc and a watch event.
-J
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues