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

Cannot read property 'file' of undefined #15

Closed
pgrm opened this issue Apr 20, 2015 · 3 comments
Closed

Cannot read property 'file' of undefined #15

pgrm opened this issue Apr 20, 2015 · 3 comments

Comments

@pgrm
Copy link
Contributor

pgrm commented Apr 20, 2015

Getting the following exception, when I'm trying to bundle my precompiled d.ts files:

[19:33:57] TypeError: Cannot read property 'file' of undefined
    at C:\project\node_modules\dts-bundle\lib\index.js:489:42
    at Array.forEach (native)
    at Object.bundle (C:\project\node_modules\dts-bundle\lib\index.js:487:25)
    at Gulp.<anonymous> (C:\project\gulp\build.js:39:9)
    at module.exports (C:\project\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (C:\project\node_modules\gulp\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (C:\project\node_modules\gulp\node_modules\orchestrator\index.js:214:10)
    at C:\project\node_modules\gulp\node_modules\orchestrator\index.js:279:18
    at finish (C:\project\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:21:8)
    at C:\project\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:52:4

Not sure if this is relevant, but I've noticed that in map exports express is missing - here the map exports dts-bundle is reporting:

### map exports ###
- buffer -> C:\project\typings\node\node.d.ts
- querystring -> C:\project\typings\node\node.d.ts
- events -> C:\project\typings\node\node.d.ts
- http -> C:\project\typings\node\node.d.ts
- cluster -> C:\project\typings\node\node.d.ts
- zlib -> C:\project\typings\node\node.d.ts
- os -> C:\project\typings\node\node.d.ts
- https -> C:\project\typings\node\node.d.ts
- punycode -> C:\project\typings\node\node.d.ts
- repl -> C:\project\typings\node\node.d.ts
- readline -> C:\project\typings\node\node.d.ts
- vm -> C:\project\typings\node\node.d.ts
- child_process -> C:\project\typings\node\node.d.ts
- url -> C:\project\typings\node\node.d.ts
- dns -> C:\project\typings\node\node.d.ts
- net -> C:\project\typings\node\node.d.ts
- dgram -> C:\project\typings\node\node.d.ts
- fs -> C:\project\typings\node\node.d.ts
- path -> C:\project\typings\node\node.d.ts
- string_decoder -> C:\project\typings\node\node.d.ts
- tls -> C:\project\typings\node\node.d.ts
- crypto -> C:\project\typings\node\node.d.ts
- stream -> C:\project\typings\node\node.d.ts
- util -> C:\project\typings\node\node.d.ts
- assert -> C:\project\typings\node\node.d.ts
- tty -> C:\project\typings\node\node.d.ts
- domain -> C:\project\typings\node\node.d.ts
- mysql -> C:\project\typings\mysql\mysql.d.ts
- bluebird -> C:\project\typings\bluebird\bluebird.d.ts
- chai -> C:\project\typings\chai\chai.d.ts
- chai-http -> C:\project\typings\chai-http\chai-http.d.ts
- mocha -> C:\project\typings\mocha\mocha.d.ts
- morgan -> C:\project\typings\morgan\morgan.d.ts
- body-parser -> C:\project\typings\body-parser\body-parser.d.ts

but I'm using also express, can that be the problem? any more information I can provide you with which would help?

@pgrm
Copy link
Contributor Author

pgrm commented Apr 20, 2015

I've added a simple console.log at the file in question and yes it's failing when express is used. But when compiling it, everything worked. I'm using tsd for all my usings so everything should be the same. Any clues?

@pgrm
Copy link
Contributor Author

pgrm commented Apr 21, 2015

The problem was that the whole files seemed to have been commented out for dts-bundle - see #16 for more details

@pgrm pgrm closed this as completed Apr 21, 2015
@rdingwall
Copy link

I had this error too, took a while to diagnose but discovered it was due to a missing /// <reference path="...d.ts" statement. Could possibly have some better error handling here.

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