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

undefined is not an object (evaluating 'exports.formatters') #51

Closed
moshmage opened this issue Dec 17, 2016 · 3 comments
Closed

undefined is not an object (evaluating 'exports.formatters') #51

moshmage opened this issue Dec 17, 2016 · 3 comments
Labels
Milestone

Comments

@moshmage
Copy link
Contributor

moshmage commented Dec 17, 2016

This is a two parter, though I think one is causing the other. Somehow, my @types/ are being ignored:

17 12 2016 19:58:36.061:INFO [compiler.karma-typescript]: Compiling project using Typescript 2.1.4
17 12 2016 19:58:37.864:ERROR [compiler.karma-typescript]: node_modules/rxjs/Observable.d.ts(68,60): error TS2304: Cannot find name 'Promise'.

17 12 2016 19:58:37.865:ERROR [compiler.karma-typescript]: node_modules/rxjs/Observable.d.ts(68,70): error TS2304: Cannot find name 'Promise'.

17 12 2016 19:58:37.865:ERROR [compiler.karma-typescript]: src/subjects/socket-io.spec.ts(6,1): error TS2304: Cannot find name 'describe'.

17 12 2016 19:58:37.866:ERROR [compiler.karma-typescript]: src/subjects/socket-io.spec.ts(7,5): error TS2304: Cannot find name 'it'.

17 12 2016 19:58:37.866:ERROR [compiler.karma-typescript]: src/subjects/socket-io.spec.ts(8,9): error TS2304: Cannot find name 'expect'.

which then probably causes the

PhantomJS 2.1.1 (Windows 7 0.0.0) ERROR
  TypeError: undefined is not an object (evaluating 'exports.formatters')
  at C:/Users/MOSHMA~1/AppData/Local/Temp/karma-typescript-bundle-976yFHybkGsMnWw.js:3602

Now, my own compilation was throwing errors about the Observable ... Promise thingy, I fixed it by installing @types/es6-shim - but that doesn't seem to fix karma-ts compiler part so I'm guessing the typescript compiler in karma counterpart is ignore the installed @types?

you can check it out @ https://gitlab.com/moshmage/rxjs-socket.io/tree/karma-typescript (karma start karma.conf.js)


configs:
tsconfig, karma.conf.js, package.json

@erikbarke
Copy link
Collaborator

I'll take a look! And thanks for providing a runnable example, it really makes troubleshooting a whole lot easier...

@erikbarke erikbarke added bug and removed question labels Dec 18, 2016
@erikbarke erikbarke added this to the 2.1.5 milestone Dec 18, 2016
@erikbarke
Copy link
Collaborator

This bug seems to have been fixed in 2.1.5, your example project works with the latest from master if I set "sourceMap": true in tsconfig.json.

You can try it out with npm i https://github.com/monounity/karma-typescript if you don't want to wait, I'm releasing 2.1.5 tomorrow.

If you don't want to set "sourceMap": true in the tsconfig.json, you can override it in the Karma config using karmaTypescriptConfig.compilerOptions.sourceMap!

@moshmage
Copy link
Contributor Author

And thanks for providing a runnable example, it really makes troubleshooting a whole lot easier...

Hah! Hoping someone finds a bug without an example, yes: I've had to do that. I enjoyed it immensely - even had a party to celebrate the fact I could reproduce the bug step by step from the overly excessive description of the post \o/ (not. ever.)

You can try it out with npm i https://github.com/monounity/karma-typescript if you don't want to wait, I'm releasing 2.1.5 tomorrow.

This worked. I also got a cut on my fingers, from that bleeding edge ;D
(thanks!)

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

2 participants