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

TS 2.2.1 broke everything! #92

Closed
jdanyow opened this issue Feb 22, 2017 · 30 comments
Closed

TS 2.2.1 broke everything! #92

jdanyow opened this issue Feb 22, 2017 · 30 comments
Labels
Milestone

Comments

@jdanyow
Copy link

jdanyow commented Feb 22, 2017

git clone https://github.com/monounity/karma-typescript
cd karma-typescript/example-project
npm install
npm test

image

@erikbarke erikbarke added the bug label Feb 23, 2017
@erikbarke
Copy link
Collaborator

Hey @jdanyow, I get the same error on my end with typescript@2.2.1. It works if I install typescript@2.1.6, so there must some breaking changes between the typescript versions...

@jdanyow
Copy link
Author

jdanyow commented Feb 23, 2017

microsoft/TypeScript#13709

@erikbarke
Copy link
Collaborator

Ok, there are breaking changes, objects that were just a plain old object literal {} are now Map objects, thanks for reporting!

@erikbarke erikbarke added this to the 2.1.8 milestone Feb 23, 2017
@erikbarke
Copy link
Collaborator

erikbarke commented Feb 23, 2017

The new ES6 module flag doesn't seem to be the cause of the problem, I've run the example project on my end with Typescript@2.2.1 + a few fixes and it works now. There are a few remaining issues with parsing the tsconfig.json, I'll probably get that sorted out today.

erikbarke added a commit that referenced this issue Feb 23, 2017
@erikbarke
Copy link
Collaborator

Ok, the build passes on Travis and AppVeyor now with Typescript@2.2.1 😃

Does the example project work for you if you install from the latest dev branch, npm install https://github.com/monounity/karma-typescript.git#2.1.8?
If you’re behind a firewall and can’t install from GitHub, you can download the branch as a zip and install manually.

All the examples have been moved into ./examples/ and the former example-project has been renamed to typescript-latest!

@iainmcgin
Copy link

Using https://github.com/monounity/karma-typescript.git#2.1.8 fixed the build for my project after upgrading to TS 2.2.1 - thanks!

@dnasir
Copy link

dnasir commented Feb 26, 2017

@erikbarke Just a suggestion - maybe you should rename the issue to something like "TS 2.2.1 broke everything!" to avoid duplicate reports in the future.

@erikbarke erikbarke changed the title example-project broken TS 2.2.1 broke everything! Feb 26, 2017
@erikbarke
Copy link
Collaborator

@dnasir, done!

@unlight
Copy link

unlight commented Feb 28, 2017

monounity/karma-typescript.git#2.1.8 works for me.
When release to npm?

@erikbarke
Copy link
Collaborator

@unlight, I'm hoping to release within a few weeks!

@erikbarke
Copy link
Collaborator

Uncaught ReferenceError: exports is not defined

(Just making sure this error message is searchable as suggested in #96)

@sgen
Copy link

sgen commented Mar 3, 2017

TS 2.2.1 and Karma-TypeScript@2.1.8 is still not working for me.

@erikbarke
Copy link
Collaborator

erikbarke commented Mar 5, 2017

3.0.0-beta.1 is on npm now with support for Typescript 2.2.1:

npm install karma-typescript@beta

(2.1.8 ended up having so much new functionality + breaking changes it was renamed to 3.0.0)

@vidartf
Copy link
Contributor

vidartf commented Mar 28, 2017

I'm getting a bunch of errors trying the beta, a few examples are included below:

28 03 2017 18:00:26.648:ERROR [compiler.karma-typescript]: node_modules/karma-typescript/tests/integration-latest/src/x-performance/6/8/5/component.spec.ts(9,44): error TS2339: Property 'toEqual' does not exist on type 'Root'.

Quite a bunch of these.

28 03 2017 18:00:26.943:ERROR [compiler.karma-typescript]: node_modules/karma/config.tpl.ts(4,19): error TS7006: Parameter 'config' implicitly has an 'any' type.

28 03 2017 18:00:26.943:ERROR [compiler.karma-typescript]: node_modules/karma/config.tpl.ts(13,18): error TS1109: Expression expected.

28 03 2017 18:00:26.943:ERROR [compiler.karma-typescript]: node_modules/karma/config.tpl.ts(13,19): error TS2304: Cannot find name 'FRAMEWORKS'.

28 03 2017 18:00:26.944:ERROR [compiler.karma-typescript]: node_modules/karma/config.tpl.ts(13,30): error TS1109: Expression expected.

Some of these.

28 03 2017 18:00:26.956:ERROR [compiler.karma-typescript]: node_modules/remap-istanbul/typings/browser/ambient/node/index.d.ts(14,11): error TS2451: Cannot redeclare block-scoped variable 'Error'.

28 03 2017 18:00:26.958:ERROR [compiler.karma-typescript]: node_modules/remap-istanbul/typings/browser/ambient/node/index.d.ts(85,6): error TS2300: Duplicate identifier 'BufferEncoding'.

28 03 2017 18:00:26.959:ERROR [compiler.karma-typescript]: node_modules/remap-istanbul/typings/browser/ambient/node/index.d.ts(457,26): error TS2300: Duplicate identifier 'Buffer'.

28 03 2017 18:00:26.960:ERROR [compiler.karma-typescript]: node_modules/remap-istanbul/typings/browser/ambient/node/index.d.ts(457,50): error TS2300: Duplicate identifier 'SlowBuffer'.

28 03 2017 18:00:26.960:ERROR [compiler.karma-typescript]: node_modules/remap-istanbul/typings/browser/ambient/node/index.d.ts(478,18): error TS2300: Duplicate identifier 'EventEmitter'.

28 03 2017 18:00:26.960:ERROR [compiler.karma-typescript]: node_modules/remap-istanbul/typings/browser/ambient/node/index.d.ts(631,18): error TS2300: Duplicate identifier 'Agent'.

28 03 2017 18:00:26.961:ERROR [compiler.karma-typescript]: node_modules/remap-istanbul/typings/browser/ambient/node/index.d.ts(676,18): error TS2300: Duplicate identifier 'Worker'.

28 03 2017 18:00:26.961:ERROR [compiler.karma-typescript]: node_modules/remap-istanbul/typings/browser/ambient/node/index.d.ts(924,22): error TS2300: Duplicate identifier 'CompleterResult'.

A lot of these.

@erikbarke
Copy link
Collaborator

erikbarke commented Mar 29, 2017

Hey @vidartf, that's weird, I'm only getting a lot of this error: node_modules/@types/lodash/index.d.ts(19507,15): error TS2428: All declarations of 'WeakMap' must have identical type parameters. and that error is tracked here: DefinitelyTyped/DefinitelyTyped#14324

I get this error on my laptop (OSX), on Travis (Ubuntu), Appveyor (Windows) but I haven't seen your errors, what OS are you on, npm version, node version, Typescript version etc?

@vidartf
Copy link
Contributor

vidartf commented Mar 29, 2017

OS: Windows (10),
npm/node: 3.10.10 / 7.2.1
Typescript: 2.2.2

@vidartf
Copy link
Contributor

vidartf commented Mar 29, 2017

I'm also seeing a lot of duplicate errors from node_modules/typescript/lib/lib.*.d.ts

@vidartf
Copy link
Contributor

vidartf commented Mar 29, 2017

Actually, the code I have is failing tsc build (although with completely different errors). Let me sort that out first and see if anything changes.

@vidartf
Copy link
Contributor

vidartf commented Mar 29, 2017

Fixed those issues with tsc, no change in karma-typescript behavior.

@vidartf
Copy link
Contributor

vidartf commented Mar 29, 2017

Here is full log with debug (from a full project, not able to do a minimal example yet): https://gist.github.com/vidartf/29e7d3204207d0ac588f8cf108324025

@vidartf
Copy link
Contributor

vidartf commented Mar 29, 2017

Actually, all those errors are from going from karma-typescript 2.1.7 -> 3.0.0. I only saw them previously because 2.1.8 got installed. On TS 2.1 I see the same errors.

Using 2.1.7 + TS 2.2.2 simply does not discover any tests (Error: Can't find expect.js [undefined] (required by <my filename>) at node_modules/karma-typescript/lib/commonjs.js:13)

@erikbarke
Copy link
Collaborator

@vidartf, I can't reproduce this... I've tried the latest from master, the latest beta from npm on Windows 10 and I just don't get these errors when running the integration tests. Could you create a minimal repro project please?

KT2.1.7 doesn't work at all with typescript TS2.2.2, there were breaking changes in TS2.2.1.

@vidartf
Copy link
Contributor

vidartf commented Mar 31, 2017

@erikbarke I narrowed the problem down. It seems that karma-typescript is messing up include/exclude patterns in tsconfig.json. See this commit in a my test repo.

@vidartf
Copy link
Contributor

vidartf commented Mar 31, 2017

More specifically, it seems to be screwing up the directory to use as the base for those patterns (it should be the same directory as the file is in?).

@vidartf
Copy link
Contributor

vidartf commented Mar 31, 2017

Extra note: Event without the include/exclude patterns, it is clear that files are being collected compared to the package root, and not relative to the typescript project root (the folder with the tsconfig file).

@erikbarke
Copy link
Collaborator

@vidartf, nice detective work, this was really easy to reproduce using your example project! I'll try to come up with a fix before the 3.0.0 release tomorrow.

@erikbarke
Copy link
Collaborator

@vidartf, I've committed a fix now, does it work if you try the latest from the master branch, npm i github:monounity/karma-typescript?

@vidartf
Copy link
Contributor

vidartf commented Apr 1, 2017

A quick test seem to work nicely 👍 3.0 also has some more things fixed compared to older versions, so I could clean up some old workarounds! :)

@vidartf
Copy link
Contributor

vidartf commented Apr 1, 2017

The updated readme text was also a nice touch 👍

@erikbarke
Copy link
Collaborator

@vidartf, awesome! This means 3.0.0 is ready for release 😄

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

No branches or pull requests

7 participants