sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Issue with Gulp-build for newly added webpart

Open kspranesh opened this issue 9 years ago • 8 comments

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

spfx-issue

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]

kspranesh avatar Sep 19 '17 22:09 kspranesh

@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?

iclanton avatar Sep 19 '17 22:09 iclanton

Yes, the file does exist in the path specified in the error and this file is auto generated with the template.

kspranesh avatar Sep 20 '17 00:09 kspranesh

What template engine is autogenerating it?

iclanton avatar Sep 20 '17 19:09 iclanton

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.

georgemak avatar Oct 03 '17 10:10 georgemak

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).

georgemak avatar Oct 03 '17 11:10 georgemak

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.

iclanton avatar Oct 25 '17 22:10 iclanton

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

jasonarden avatar Nov 15 '17 19:11 jasonarden

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

msft-github-bot avatar Jan 29 '20 00:01 msft-github-bot