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

plenty of Duplicate identifier errors due to typings/browser.d.ts reference in vg-player.d.ts #109

Closed
petervojtek opened this issue Apr 7, 2016 · 5 comments

Comments

@petervojtek
Copy link

Description

The issue is, I have typings located in my_angular_project/typings/ (including browser.d.ts)

However vg-player.d.ts has on the first line following reference:

/// <reference path="../../node_modules/angular2/typings/browser.d.ts" />

and actually keeps its own browser.d.ts in

my_angular_project/node_modules/videogular2/node_modules/angular2/typings/browser.d.ts

I guess this means browser.d.ts is loaded twice during ts->js transpilation, which leads to plenty of errors like:

ERROR in [default] my_angular_project/node_modules/videogular2/node_modules/angular2/typings/browser.d.ts:6:13 
Duplicate identifier 'PromiseConstructor'.

When I remove the first line (reference path) from `vg-player.d.ts, I can get rid of the errors.

I guess this could be somehow fixed by proper configuration of tsconfig.json, but I did not managed to achieve it. Here is my tsconfig.json:

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true
  },
  "filesGlob": [
    "**/*.ts",
    "!node_modules/**/*"
  ],
  "exclude": [
    "node_modules",
    "typings/main",
    "typings/main.d.ts"
  ],
  "compileOnSave": false,
  "atom": {
    "rewriteTsconfig": false
  }
}
@Elecash
Copy link
Member

Elecash commented Apr 7, 2016

I'm not seeing those errors in my example project.

This is my tsconfig.json:

https://github.com/videogular/videogular2/blob/master/examples/src/tsconfig.json

@petervojtek
Copy link
Author

thanks for quick response.

Btw when I merge your tsconfig.json into mine, I end up with following error:

Unhandled rejection Error: Cannot resolve module 'ionic-angular' in app
    Required in app/app.ts
    at ResolutionError.Error (native)
    at new ResolutionError (my_app/node_modules/awesome-typescript-loader/dist.babel/deps.js:482:88)
    at my_app/node_modules/awesome-typescript-loader/dist.babel/deps.js:301:37
    at tryCatcher (my_app/node_modules/awesome-typescript-loader/node_modules/bluebird/js/main/util.js:26:23)
    at CatchFilter.doFilter (my_app/node_modules/awesome-typescript-loader/node_modules/bluebird/js/main/catch_filter.js:52:40)
    at CatchFilter.tryCatcher (my_app/node_modules/awesome-typescript-loader/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (my_app/node_modules/awesome-typescript-loader/node_modules/bluebird/js/main/promise.js:507:31)
    at Promise._settlePromiseAt (my_app/node_modules/awesome-typescript-loader/node_modules/bluebird/js/main/promise.js:581:18)
    at Promise._settlePromises (my_app/node_modules/awesome-typescript-loader/node_modules/bluebird/js/main/promise.js:697:14)
    at Async._drainQueue (my_app/node_modules/awesome-typescript-loader/node_modules/bluebird/js/main/async.js:123:16)
    at Async._drainQueues (my_app/node_modules/awesome-typescript-loader/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (my_app/node_modules/awesome-typescript-loader/node_modules/bluebird/js/main/async.js:15:14)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

and when I use exactly the same tsconfig.json as you do, I get the Duplicate identifier errors.

I actually use Ionic beta via ionic serve command, which I guess brings some additional config/build process for typescript and probably that is why I cannot benefit from your tsconfig.json.

@Fluccioni
Copy link

Hello @petervojtek, Do you found a solution since the message was posted because I have the same issue and I'm not able to find a proper way to compile. Thanks

@petervojtek
Copy link
Author

hi @Fluccioni , so far the only solution i found is the one described in my first comment, and this is to remove first line from vg-player.d.ts, i.e. remove this line:

/// <reference path="../../node_modules/angular2/typings/browser.d.ts" />

@Elecash
Copy link
Member

Elecash commented Jun 26, 2016

Please, update to latest version and check if this problems still exists.

@Elecash Elecash closed this as completed Aug 15, 2016
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