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

Type Timer not assignable to type Number #68

Closed
braidn opened this issue Aug 19, 2017 · 11 comments
Closed

Type Timer not assignable to type Number #68

braidn opened this issue Aug 19, 2017 · 11 comments

Comments

@braidn
Copy link

braidn commented Aug 19, 2017

After recently starting a new project with Bobril (within the last 30 minutes), I am getting the the above error against this line of code:

waitingForPopHashChange = setTimeout(emitOnHashChange, 50);

After fishing around for a bit, waitingForPopHashChange is a numeric where setTimeout is a timer. Is this a legit error or something perhaps I messed up when installing the project?

@Bobris
Copy link
Owner

Bobris commented Aug 19, 2017

It is posible you got node.d.ts definition into project which overloaded standart typescript one for browser.
Normaly setTimeout(handler: (...args: any[]) => void, timeout: number): number; is in Typescript lib.dom.d.ts which is included by Bobril-build

@braidn
Copy link
Author

braidn commented Aug 20, 2017

This would be viewable under node_modules/@types correct?

I do have one folder in this directory and it is for node. However, setting up a new node environment using 8.3.0, removing yarn.lock/yarn, still does nothing to change the error or remove the node folder from being automatically added to node_modules when running the bb command.

So bizarre.

@Bobris
Copy link
Owner

Bobris commented Aug 20, 2017

It has to be some dependency in your package.json. If you can post it here I can help you find it ...

@braidn
Copy link
Author

braidn commented Aug 20, 2017

{
  "name": "bobrilPlayground",
  "version": "1.0.0",
  "main": "./app/index.ts",
  "license": "MIT",
  "devDependencies": {
    "bobril": "^7.5.0",
    "bobril-build": "^0.74.1",
    "tslint": "^5.6.0",
    "typescript": "^2.4.2"
  },
  "resolutions": {
    "glob": "7.1.2",
    "uglify-js": "2.3.6",
    "supports-color": "3.2.3",
    "kind-of": "4.0.0",
    "is-number": "3.0.0",
    "balanced-match": "0.4.2",
    "minimist": "0.0.8",
    "assert-plus": "1.0.0",
    "colors": "1.0.3",
    "source-map": "0.1.43",
    "esprima": "3.0.0",
    "wordwrap": "0.0.3",
    "typescript": "2.5.1"
  }
}

@Bobris
Copy link
Owner

Bobris commented Aug 20, 2017

Reproduced, give me some time to debug ...

@Bobris
Copy link
Owner

Bobris commented Aug 20, 2017

Typescript compiler when not defined loads automaticaly all @types, luckily you can prevent it by adding this section to your package.json:

"bobril": {
    "compilerOptions": {
        "types": []
    }
},

It will define to Typescript compiler that it should load only specified type modules - and you don't need any.

@Bobris
Copy link
Owner

Bobris commented Aug 20, 2017

Also one minor nitpick "bobril" should be in your "dependencies" and not "devDependencies".

@Bobris
Copy link
Owner

Bobris commented Aug 22, 2017

This looks like new severe problem, I will fix it inside bobril-build so workaround will not be need.

@Bobris
Copy link
Owner

Bobris commented Sep 1, 2017

Latest bobril-build 0.75.0 fixes this automatically.

@Bobris Bobris closed this as completed Sep 1, 2017
@braidn
Copy link
Author

braidn commented Sep 1, 2017

Yes! Thank you so much for the fix

@sarazeaiter1
Copy link

sarazeaiter1 commented Sep 26, 2018

this may help ur issue

    ref(): void;
    unref(): void;
  };

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

3 participants