Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helloworld webpart tutorial typescript compile errors in build task #117

Closed
1 of 3 tasks
brandanmajeske opened this issue Feb 3, 2017 · 2 comments
Closed
1 of 3 tasks

Comments

@brandanmajeske
Copy link

Category

  • Question
  • Bug
  • Enhancement

Expected or Desired Behavior

Following HelloWorld tutorial, attempting to build project "gulp serve" without errors.

Observed Behavior

On a Windows dev machine, after setting up dev environment and scaffolding project with Yeoman SharePoint Generator, the next step is to build/preview the webpart, but I am encountering errors in the typescript subtask.

Attempted on two separate machines with same result. Possibly related to Issue 14384

Steps to Reproduce

Run Yeoman Sharepoint Generator, run 'gulp serve', errors result:

[10:49:51] Using gulpfile ~\Projects\helloworld\gulpfile.js
[10:49:51] Starting gulp
[10:49:51] Starting 'serve'...
[10:49:51] Starting subtask 'pre-copy'...
[10:49:51] Finished subtask 'pre-copy' after 5.28 ms
[10:49:51] Starting subtask 'copyStaticAssets'...
[10:49:51] Starting subtask 'sass'...
[10:49:51] Finished subtask 'sass' after 359 ms
[10:49:51] Starting subtask 'tslint'...
[10:49:51] Starting subtask 'typescript'...
[10:49:51] [typescript] Using custom version: 2.0.10
[10:49:51] Finished subtask 'copyStaticAssets' after 404 ms
[10:49:53] Error - typescript - node_modules@types\lodash\index.d.ts(11444,21): error TS1005: ']' expected.
[10:49:53] Error - typescript - node_modules@types\lodash\index.d.ts(11444,22): error TS1005: ';' expected.
[10:49:53] Error - typescript - node_modules@types\lodash\index.d.ts(11444,23): error TS1128: Declaration or statement expected.
[10:49:53] Error - typescript - node_modules@types\lodash\index.d.ts(11444,33): error TS1005: ']' expected.
[10:49:53] Error - typescript - node_modules@types\lodash\index.d.ts(11444,34): error TS1005: ')' expected.
[10:49:53] Error - typescript - node_modules@types\lodash\index.d.ts(11444,35): error TS1128: Declaration or statement expected.
[10:49:53] Error - typescript - node_modules@types\lodash\index.d.ts(11444,37): error TS1128: Declaration or statement expected.
[10:49:53] Error - typescript - node_modules@types\lodash\index.d.ts(19441,1): error TS1128: Declaration or statement expected.
[10:49:53] Finished subtask 'tslint' after 1.6 s
[10:49:53] Error - 'typescript' sub task errored after 1.62 s
"TypeScript error(s) occurred."
[10:49:53] 'serve' errored after 2.01 s
[10:49:53]
[10:49:53] ==================[ Finished ]==================
Error - typescript - node_modules@types\lodash\index.d.ts(11444,21): error TS1005: ']' expected.
Error - typescript - node_modules@types\lodash\index.d.ts(11444,22): error TS1005: ';' expected.
Error - typescript - node_modules@types\lodash\index.d.ts(11444,23): error TS1128: Declaration or statement expected.
Error - typescript - node_modules@types\lodash\index.d.ts(11444,33): error TS1005: ']' expected.
Error - typescript - node_modules@types\lodash\index.d.ts(11444,34): error TS1005: ')' expected.
Error - typescript - node_modules@types\lodash\index.d.ts(11444,35): error TS1128: Declaration or statement expected.
Error - typescript - node_modules@types\lodash\index.d.ts(11444,37): error TS1128: Declaration or statement expected.
Error - typescript - node_modules@types\lodash\index.d.ts(19441,1): error TS1128: Declaration or statement expected.
Error - 'typescript' sub task errored after 1.62 s
"TypeScript error(s) occurred."
[10:49:54] Project helloworld version: 0.0.1
[10:49:54] Build tools version: 1.1.0
[10:49:54] Node version: v6.9.4
[10:49:54] Total duration: 4.15 s
[10:49:54] Task errors: 9

@davidhartman
Copy link
Contributor

@brandanmajeske it is definitely an issue with your typescript version, I tested it and got the same errors as you. To fix it, before running "gulp serve" run the following npm command to update your typescript version:

npm install typescript@latest

or to do globally (so you don't have to do this for every project)
npm install -g typescript@latest

and everything should be good to go

@brandanmajeske
Copy link
Author

brandanmajeske commented Feb 3, 2017

Thanks David. Odd thing, my dev environments global version of typescript was already the latest (2.1.5), but running the command without the global flag has fixed the problem. No errors now running 'gulp serve'. Thanks again!

Edit: I checked the version of typescript installed by the Yeoman SharePoint Generator, and it was 2.0.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants