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

BUG: SPFx Builds Fail after March 19 ~1900UTC | gulp-core-build-typescript update breaks builds #501

Closed
2 of 5 tasks
andrewconnell opened this issue Mar 20, 2017 · 11 comments

Comments

@andrewconnell
Copy link
Collaborator

andrewconnell commented Mar 20, 2017

Category

  • Question
  • Typo
  • Bug
  • Enhancement / Suggestion
  • Additional article idea

Expected or Desired Behavior

Builds succeed on the default project created from accepting all defaults in the Yeoman generator.

Observed Behavior

Builds fail TypeScript transpilation step... specifically the subtask typescript. Errors start with the following & yield 25 errors.

21:39:28] Starting subtask 'typescript'...
[21:39:28] [typescript] TypeScript version: 2.2.1
[21:39:28] Finished subtask 'copy-static-assets' after 523 ms
[21:39:29] Error - typescript - node_modules/@microsoft/sp-http/lib/httpClient/HttpClientResponse.d.ts(16,21): error TS2420: Class 'HttpClientResponse' incorrectly implements interface 'Response'.
[21:39:29] Error - typescript - node_modules/@types/whatwg-fetch/index.d.ts(5,14): error TS2300: Duplicate identifier 'Request'.
[21:39:29] Error - typescript - node_modules/@types/whatwg-fetch/index.d.ts(20,1): error TS2403: 
[...]

Steps to Reproduce

  1. Install all prereqs using any version of Node (verified with Node.js v4.*, v6.* & v7.*)
  2. Run the generator $ yo @microsoft/sharepoint and accept all defaults
  3. Build the project... it will fail as seen in the screenshot below

Steps to Resolve

Uninstall the updated gulp-core-build-typescript package updated March 19, 2017 ~1900 UTC (see microsoft/rushstack@0a793bc for commit that triggered the issue) which is version 2.4.0. Revert back to 2.3.0 which will work. Install 2.4.1 which patches the issue that caused this regression (see below for info).

  1. After the SharePoint generator completes, before building the project, delete gulp-core-build-typescript:
rm -rf node_modules/@microsoft/gulp-core-build-typescript

note the step above is NOT required as the next step will simply overwrite the old version... I added it here to be explicit.

  1. Reinstall the previous working version:
npm install @microsoft/[email protected]
  1. Now run gulp build and the project will successfully transpile.

PERSONAL REQUEST by OP

Microsoft SPFx Engineer: PLEASE PLEASE consider this a feature request... PLEASE shrink wrapping ref npm shrinkwrap the dev tools... this is the second time an upstream dependency has broken development for your adopters of the SharePoint Framework and it's unecessarily giving SPFx a bad rep. I thought the #394 "lodash-gate" incident would have been enough to consider this prior to GA. This is a common technique for packages that have significant number of dependencies such as this.

pasted_image_at_2017_03_19_06_16_pm

@davidhartman
Copy link

Thanks @andrewconnell I've been trying to figure this issue out for the past few hours.

@patmill
Copy link
Contributor

patmill commented Mar 20, 2017

Fixed with gcb-typescript 2.4.1. There is a shrinkwrap work item on the backlog as well.

@waldekmastykarz
Copy link
Collaborator

Not sure if it's related but I've just created a new project and while it's building, there are a few instances of the following warning displayed:

Could not find implementations for the following rules specified in the configuration:
    prefer-const
Try upgrading TSLint and/or ensuring that you have all necessary custom rules installed.
If TSLint was recently upgraded, you may have old rules configured which need to be cleaned up.

@andrewconnell
Copy link
Collaborator Author

andrewconnell commented Mar 20, 2017

Little more detail for those tracking... here's the fix that @patmill referenced: microsoft/rushstack#140

Updated resolution step in my OP above to use the more current version...

@andrewconnell
Copy link
Collaborator Author

@waldekmastykarz check your TSLint... With the latest version & a clean project, I don't see any of that.

@andrewconnell
Copy link
Collaborator Author

@patmill since the 2.4.1 patch has been published for gulp-core-build-typescript, appears this issue is now moot. This should be flagged as a bug... but I'm going to go ahead and close it.

@waldekmastykarz
Copy link
Collaborator

I've just created a brand new project @andrewconnell (no JS framework): still the same error

@waldekmastykarz
Copy link
Collaborator

Error is reported only on a vanilla SPFx project. After scaffolding the project and running

npm i @microsoft/gulp-core-build-typescript -D

no error is reported anymore.

@patmill
Copy link
Contributor

patmill commented Mar 20, 2017 via email

@waldekmastykarz
Copy link
Collaborator

It's on @microsoft/[email protected] @patmill

@msft-github-bot
Copy link
Collaborator

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

@SharePoint SharePoint locked as resolved and limited conversation to collaborators Jan 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants