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

Run demo on new typescript #47

Closed
wants to merge 2 commits into from
Closed

Run demo on new typescript #47

wants to merge 2 commits into from

Conversation

@anp
Copy link

anp commented Nov 9, 2017

Not a particularly useful PR, but when attempting to run the demo locally the semver bound in package.json allows TypeScript 2.6.1 to be installed, which seems to break the client demo build:

ERROR in ./src/text.ts
(251,23): error TS2345: Argument of type '{ body: string; headers: { 'Content-Type': string; }; method: string;}' is not assignable to parameter of type 'RequestInit | undefined'.
  Type '{ body: string; headers: { 'Content-Type': string; }; method: string; }' is not assignable to type 'RequestInit'.
    Types of property 'headers' are incompatible.
      Type '{ 'Content-Type': string; }' is not assignable to type 'Headers | string[][] | undefined'.
        Object literal may only specify known properties, and ''Content-Type'' does not exist in type 'Headers | string[][] | undefined'.

ERROR in ./src/text.ts
(253,17): error TS7006: Parameter 'response' implicitly has an 'any' type.

ERROR in ./src/text.ts
(256,17): error TS7006: Parameter 'buffer' implicitly has an 'any' type.

ERROR in ./src/svg-loader.ts
(110,23): error TS2345: Argument of type '{ body: string; headers: { 'Content-Type': string; }; method: string;}' is not assignable to parameter of type 'RequestInit | undefined'.
  Type '{ body: string; headers: { 'Content-Type': string; }; method: string; }' is not assignable to type 'RequestInit'.
    Types of property 'headers' are incompatible.
      Type '{ 'Content-Type': string; }' is not assignable to type 'Headers | string[][] | undefined'.
        Object literal may only specify known properties, and ''Content-Type'' does not exist in type 'Headers | string[][] | undefined'.

ERROR in ./src/svg-loader.ts
(112,17): error TS7006: Parameter 'response' implicitly has an 'any' type.

ERROR in ./src/svg-loader.ts
(115,17): error TS7006: Parameter 'buffer' implicitly has an 'any' type.

I also added yarn.lock to gitignore since the README recommends npm, but would be happy to revert.

I suspect that resolving the TS errors with more accurate type defs might be more reasonable, but this allowed me to run the demo on a fresh clone.

@Bobo1239
Copy link
Contributor

Bobo1239 commented Nov 9, 2017

This is microsoft/TypeScript#19656 whose fix isn't in a release yet. If you switch typescript's version to next in package.json it builds without errors.

@anp
Copy link
Author

anp commented Nov 9, 2017

Oh, fantastic!

@anp anp closed this Nov 9, 2017
@whmountains
Copy link

whmountains commented Nov 9, 2017

Don't close, we need the fix.

@anp
Copy link
Author

anp commented Nov 9, 2017

Really? Presumably the TS changes will release soon?

@anp anp reopened this Nov 9, 2017
@pcwalton
Copy link
Collaborator

pcwalton commented Nov 10, 2017

I'm confused :)

@anp
Copy link
Author

anp commented Nov 10, 2017

from irc if anyone's following along here:

4:14 PM <dikaiosune> pcwalton: so am i
4:15 PM <•pcwalton> dikaiosune: I’m going to keep the PR open in case MS releases a new version soon
4:15 PM <•pcwalton> if not, then I’ll merge it
@pcwalton
Copy link
Collaborator

pcwalton commented Nov 14, 2017

2578298 includes this.

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

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.