fenomas Posted May 24, 2015 Share Posted May 24, 2015 Hi, I tried to do something with BJS from typescript, but compiling gives me a raft of errors:/usr/local/lib/node_modules/typescript/bin/lib.d.ts(5550,5): error TS2300: Duplicate identifier 'pointerLockElement'./usr/local/lib/node_modules/typescript/bin/lib.d.ts(5584,5): error TS2300: Duplicate identifier 'webkitIsFullScreen'./usr/local/lib/node_modules/typescript/bin/lib.d.ts(11288,5): error TS2300: Duplicate identifier 'movementX'./usr/local/lib/node_modules/typescript/bin/lib.d.ts(11289,5): error TS2300: Duplicate identifier 'movementY'.typings/babylon.2.1.d.ts(314,5): error TS2300: Duplicate identifier 'webkitIsFullScreen'.typings/babylon.2.1.d.ts(321,5): error TS2300: Duplicate identifier 'pointerLockElement'.typings/babylon.2.1.d.ts(362,5): error TS2300: Duplicate identifier 'movementX'.typings/babylon.2.1.d.ts(363,5): error TS2300: Duplicate identifier 'movementY'.It looks like BJS declares things already declared in the built-in files. This is just from referencing the type definition, there isn't any code at all. Does everyone else not get this? Or is there a way to make tsc ignore it? Quote Link to comment Share on other sites More sharing options...
RaananW Posted May 24, 2015 Share Posted May 24, 2015 Hi, to me it looks like you have somewhere another definition file that is being included. The first few errors come from the lib.d.ts, the main TypeScript definition file. How does your referencing definition look like? How do you compile TypeScript? Quote Link to comment Share on other sites More sharing options...
fenomas Posted May 25, 2015 Author Share Posted May 25, 2015 Hi, I'm compiling withtsc index.ts and index.ts is simply:/// <reference path="babylon.2.1.d.ts"/>There is nothing else in the folder except those two files. Any ideas? Quote Link to comment Share on other sites More sharing options...
RaananW Posted May 26, 2015 Share Posted May 26, 2015 Just an idea - What version of tsc are you using?The pointerLockElement (for example) is at the updated lib.d.ts in row 5683. In Babylon, those variables are defined in the Mixins interfaces file. You might be using a version where it is either already defined and not needed in the mixins, or a version that doesn't support mixins. Quote Link to comment Share on other sites More sharing options...
fenomas Posted May 27, 2015 Author Share Posted May 27, 2015 Hi, I'm just using the current version of typescript from npm, which at the moment is "[email protected]". So to confirm, others are not getting these errors right? I tried both the 2.0 and 2.1 definition files, and both give the errors, just on an empty .ts file containing nothing but the reference. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 27, 2015 Share Posted May 27, 2015 Do you mind creating a zip with your working folder? Quote Link to comment Share on other sites More sharing options...
fenomas Posted May 27, 2015 Author Share Posted May 27, 2015 There's nothing in the folder but the definition and the typescript file.Last login: Thu May 28 01:43:52 on ttys003andy:~> mkdir tempandy:~> cd temp/andy:temp> curl -sO https://raw.githubusercontent.com/BabylonJS/Babylon.js/master/babylon.2.1.d.tsandy:temp> echo '/// <reference path="babylon.2.1.d.ts"/>' > index.tsandy:temp> npm install [email protected] node_modules/typescriptandy:temp> ls -latotal 488drwxr-xr-x 5 andy staff 170 May 28 01:50 .drwxr-xr-x+ 43 andy staff 1462 May 28 01:50 ..-rw-r--r-- 1 andy staff 245445 May 28 01:50 babylon.2.1.d.ts-rw-r--r-- 1 andy staff 41 May 28 01:50 index.tsdrwxr-xr-x 4 andy staff 136 May 28 01:50 node_modulesandy:temp> ./node_modules/typescript/bin/tsc index.ts/Users/andy/temp/node_modules/typescript/bin/lib.d.ts(5550,5): error TS2300: Duplicate identifier 'pointerLockElement'./Users/andy/temp/node_modules/typescript/bin/lib.d.ts(5584,5): error TS2300: Duplicate identifier 'webkitIsFullScreen'./Users/andy/temp/node_modules/typescript/bin/lib.d.ts(11288,5): error TS2300: Duplicate identifier 'movementX'./Users/andy/temp/node_modules/typescript/bin/lib.d.ts(11289,5): error TS2300: Duplicate identifier 'movementY'.babylon.2.1.d.ts(314,5): error TS2300: Duplicate identifier 'webkitIsFullScreen'.babylon.2.1.d.ts(321,5): error TS2300: Duplicate identifier 'pointerLockElement'.babylon.2.1.d.ts(362,5): error TS2300: Duplicate identifier 'movementX'.babylon.2.1.d.ts(363,5): error TS2300: Duplicate identifier 'movementY'.andy:temp> Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 27, 2015 Share Posted May 27, 2015 could you share index.ts? Quote Link to comment Share on other sites More sharing options...
RaananW Posted May 27, 2015 Share Posted May 27, 2015 Just checked with 1.5, it seems like there is a problem compiling Babylon using this beta version.go back to 1.4, the stable release and try. Should work without a problem. 1.5 is still in beta, need to see what causes this. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 27, 2015 Share Posted May 27, 2015 The reason is that ts 1.5 beta adds support for window.'pointerLockElement' for instance where 1.4 didn't. So bjs added them. We need to stick with ts 1.4 for now Quote Link to comment Share on other sites More sharing options...
fenomas Posted May 28, 2015 Author Share Posted May 28, 2015 Yuck. Thanks Raanan. Quote Link to comment Share on other sites More sharing options...
olrehm Posted July 24, 2015 Share Posted July 24, 2015 Wouldn't it make sense to keep such 'polyfills' in a separate file, so that they can be included or excluded from the build depending on the typescript version used? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.