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

Dependent typings not resolving in compilation #39

Closed
amcdnl opened this issue Jan 29, 2016 · 9 comments
Closed

Dependent typings not resolving in compilation #39

amcdnl opened this issue Jan 29, 2016 · 9 comments

Comments

@amcdnl
Copy link

amcdnl commented Jan 29, 2016

so when I install the typings for this project, I get errors from child typings inside popsicle not resolving.

typings.json

{
  "dependencies": {
    "popsicle": "npm:popsicle"
  }
}

_typings install output_

i:node austin$ typings install

├─┬ popsicle
│ ├── arrify
│ ├── concat-stream
│ ├── form-data
│ ├── infinity-agent
│ ├─┬ make-error-cause
│ │ └── make-error
│ ├── methods
│ ├─┬ native-or-bluebird
│ │ └── es6-promise
│ ├── tough-cookie
│ └── xtend

then when i run tsc I get:

node austin$ tsc

1 import makeErrorCause = require('make-error-cause');
                                  ~~~~~~~~~~~~~~~~~~

node_modules/popsicle/dist/error.d.ts(1,33): error TS2307: Cannot find module 'make-error-cause'.


1 import Promise = require('native-or-bluebird');
                           ~~~~~~~~~~~~~~~~~~~~

node_modules/popsicle/dist/index.d.ts(1,26): error TS2307: Cannot find module 'native-or-bluebird'.


1 import { CookieJar } from 'tough-cookie';
                            ~~~~~~~~~~~~~~

node_modules/popsicle/dist/jar.d.ts(1,27): error TS2307: Cannot find module 'tough-cookie'.


1 import Promise = require('native-or-bluebird');
                           ~~~~~~~~~~~~~~~~~~~~

node_modules/popsicle/dist/request.d.ts(1,26): error TS2307: Cannot find module 'native-or-bluebird'.


1 import makeErrorCause = require('make-error-cause');
                                  ~~~~~~~~~~~~~~~~~~

node_modules/popsicle/dist/error.d.ts(1,33): error TS2307: Cannot find module 'make-error-cause'.


1 import Promise = require('native-or-bluebird');
                           ~~~~~~~~~~~~~~~~~~~~

node_modules/popsicle/dist/index.d.ts(1,26): error TS2307: Cannot find module 'native-or-bluebird'.


1 import { CookieJar } from 'tough-cookie';
                            ~~~~~~~~~~~~~~

node_modules/popsicle/dist/jar.d.ts(1,27): error TS2307: Cannot find module 'tough-cookie'.


1 import Promise = require('native-or-bluebird');
                           ~~~~~~~~~~~~~~~~~~~~

node_modules/popsicle/dist/request.d.ts(1,26): error TS2307: Cannot find module 'native-or-bluebird'.


32   async cypher(statement: string, parameters: any = {}) {
           ~~~~~~

Shouldn't it resolve those automatically for me?

@blakeembrey
Copy link
Member

Actually, it does. If you look in the compiled typings/main/definitions/popsicle/popsicle.d.ts you'll see it's correct. I need to workaround (hack) this from the compiler, the relevant issue is microsoft/TypeScript#6427.

Edit: This is definitely something on my roadmap to fix ASAP because it's pretty painful.

@dmikov
Copy link

dmikov commented Feb 1, 2016

Actually, it doesn't. In terms, that it doesn't copy other definitions into the typings folder.
For instance even though the typings.json calls for all of the above modules, the d.ts files are missing from in typings/definition folder

@blakeembrey
Copy link
Member

@dmikov Actually, it does. It's how Typings has worked since I originally wrote it.

image

@davidstellini
Copy link

Any updates on this one? Meanwhile, what is the workaround, running typings install on each of the referenced libraries? I can't use "moduleResolution": "classic", that's going to break other libraries for me..

@blakeembrey
Copy link
Member

Yes, I understand. I would like it to work for myself too 😄 Watch out for Typings@0.7, I'm going to try doing a simpler intermediate patch to fix the use-case of native "Typings" libraries.

@davidstellini
Copy link

Thanks! Right now I'm facing the sitiuation where moduleResolution:node breaks popsicle and moduleResolution:classic breaks angular 2.

@blakeembrey
Copy link
Member

Yeah, I completely understand. I'm in the same boat, and have been for a long time - just didn't have time to properly patch it. I think I just got to it though, so there should be a 0.7 release for next week that patches this.

@blakeembrey
Copy link
Member

If you install typings@0.7, this should now be resolved. If it is not, please open an issue in Typings.

@blakeembrey
Copy link
Member

@dowrow Please create an issue. I have no desire to help someone who just comments on a random thread with complaints but gives no issue and complains about completely unrelated things - whether you use Angular 2 or React is unrelated, I've never even used Angular 2 myself.

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

No branches or pull requests

4 participants