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

TypeScript compile error #35

Closed
uMaxmaxmaximus opened this issue May 16, 2016 · 16 comments
Closed

TypeScript compile error #35

uMaxmaxmaximus opened this issue May 16, 2016 · 16 comments

Comments

@uMaxmaxmaximus
Copy link

uMaxmaxmaximus commented May 16, 2016

TypeScript 1.8.10

image

image

head in index.ts

/// <reference path="../typings/node/node.d.ts" />
/// <reference path="../typings/lib.es6/lib.es6.d.ts" />
/// <reference path="../typings/socket.io/socket.io.d.ts" />
/// <reference path="../typings/mongodb/mongodb.d.ts" />
/// <reference path="../typings/lodash/lodash.d.ts" />
/// <reference path="../typings/bluebird/bluebird.d.ts" />

tsconfig.json

{
  "compilerOptions": {
    "experimentalAsyncFunctions": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "moduleResolution": "node",
    "module": "commonjs",
    "sourceMap": true,
    "target": "ES6",
    "pretty": true
  },

  "externalTranspiler": "babel",

  "files": [
    "./server/index.ts"
  ],
  "exclude": [
    "node_modules"
  ]
}
@notheotherben
Copy link
Member

Hi Ivan,

Looks like it may be a lodash type definition issue - I've made an update in 7.0.0-alpha.6 to see if it fixes this (and also to improve the behaviour). Please take a look and let me know if it works for you or not.

Regards,
Benjamin

@uMaxmaxmaximus
Copy link
Author

uMaxmaxmaximus commented May 16, 2016

I'm a noob, tell me how to download alpha version from npm?

npm install iridium 7.0.0-alpha.6 like this?
please tell command to set the alpha version

@notheotherben
Copy link
Member

notheotherben commented May 16, 2016

Hi Ivan,

Almost there, the version separator is the '@' symbol, so this should work.

npm install iridium@7.0.0-alpha.6

EDIT: Fixed typo - alpha.6 instead of alpha.7

@uMaxmaxmaximus
Copy link
Author

uMaxmaxmaximus commented May 16, 2016

compile error

image

image

lodash.d.ts 4.0.0 Changelog (https://github.com/lodash/lodash/wiki/Changelog)

image

what is your lodash.d.ts version?

@notheotherben
Copy link
Member

notheotherben commented May 16, 2016

That's really disappointing - let me take a look at the lodash typings file quickly, forOwn should be present according to the docs

@uMaxmaxmaximus
Copy link
Author

uMaxmaxmaximus commented May 16, 2016

I change ext to load it =) ext is .ts lodash.d.txt
this file on github https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/lodash/lodash.d.ts

P.S. i install iridium@7.0.0-alpha.6 version

@uMaxmaxmaximus
Copy link
Author

uMaxmaxmaximus commented May 16, 2016

        forOwn<T>(
            object: Dictionary<T>,
            iteratee?: DictionaryIterator<T, any>
        ): Dictionary<T>;

you specify the context of the challenges of the third argument, and does not support the definition of typescript type this inside the function, in this this option at all missed. This error lodash.d

this is fix error context?:any

        forOwn<T>(
            object: Dictionary<T>,
            iteratee?: DictionaryIterator<T, any>,
            context?:any
        ): Dictionary<T>;

        /**
         * @see _.forOwn
         */
        forOwn<T extends {}>(
            object: T,
            iteratee?: ObjectIterator<any, any>,
            context?:any
        ): T;

Please send it fix to the creators lodash.d cuz I do not know how to do it =) i noob on github

@notheotherben
Copy link
Member

Hi Ivan,

I've put out 7.0.0-alpha.7 (npm install iridium@7.0.0-alpha.7) which includes the latest lodash file, it appears to include the lines you've got there but please let me know if it doesn't solve the problem.

Regards,
Benjamin

@uMaxmaxmaximus
Copy link
Author

uMaxmaxmaximus commented May 16, 2016

occur the same mistakes. I said what's the problem. It is that in lodash.d not described the third parameter of the function indicating the context, even in the most recent version lodash.d.

If I remove the line in my script
/// <Reference path = "../ typings / lodash / lodash.d.ts" />
the write error "lodash mkdule in not found"

@notheotherben
Copy link
Member

So this is what's in the latest lodash.d.ts file:

image

Unfortunately I'm not getting any compiler errors on my side, any chance you have your own local type definition file which is out of date?

@uMaxmaxmaximus
Copy link
Author

i use this https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/lodash/lodash.d.ts
this "official" lodash.d.ts , no?

image

@notheotherben
Copy link
Member

I see, I'm using this one, which I believe is a little more up to date: https://github.com/typed-typings/npm-lodash/blob/master/index.d.ts

@notheotherben
Copy link
Member

DefinitelyTyped has been deprecated in favour of https://github.com/typings/typings

@uMaxmaxmaximus
Copy link
Author

uMaxmaxmaximus commented May 16, 2016

I did not know =) sorry. and you can not override the forOwn function types description manually in your script, not to depend on the version lodash.d? as a small hack

@uMaxmaxmaximus
Copy link
Author

uMaxmaxmaximus commented May 16, 2016

omg "typings" is epic =)!

Thank you, I have lived in darkness, let's close the ticket. but I also think that you should be somewhere in the documentation write depending on the framework files d.ts

@notheotherben
Copy link
Member

I probably could, and it may well be something I look at doing going forward, but for now the lodash implementation is nice and reliable.

I actually should have checked that first, version 7 is the typings upgrade, while version 6 is using definitely typed. I'll make sure that there's a notice to that effect in the README when I'm ready to release 7.0.0 👍.

Anyway, let me know if you run into any other issues, I'll do what I can to help out.

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