# Using preview getting ts errors

**URL:** <https://forum.babylonjs.com/t/using-preview-getting-ts-errors/5290>\
**Category:** Questions\
**Created:** [August 26, 2019, 4:21pm UTC](https://forum.babylonjs.com/t/using-preview-getting-ts-errors/5290 "2019-08-26T16:21:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![delaneyj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/delaneyj/32/3148_2.png) [@delaneyj](https://forum.babylonjs.com/u/delaneyj)\
**Post date:** [August 26, 2019, 4:21pm UTC](https://forum.babylonjs.com/t/using-preview-getting-ts-errors/5290/1 "2019-08-26T16:21:00Z")

</div>

changed `package.json` from

```auto
"@babylonjs/core": "^4.0.3",
"@babylonjs/inspector": "^4.0.3",
"@babylonjs/loaders": "^4.0.3",
"@babylonjs/materials": "^4.0.3",
"@babylonjs/serializers": "^4.0.3",

```

to

```auto
    "@babylonjs/core": "^4.1.0-alpha.16",
    "@babylonjs/inspector": "^4.1.0-alpha.16",
    "@babylonjs/loaders": "^4.1.0-alpha.16",
    "@babylonjs/materials": "^4.1.0-alpha.16",
    "@babylonjs/serializers": "^4.1.0-alpha.16",

```

Removed node\_modules, even try removing yarn.lock. But seeing a [similar error elsewhere](https://forum.babylonjs.com/t/define-typescript-interface-for-options-of-method-to-make-screenshots/4713/40) per @sebavan’s advice I made sure everything was on the preview version.

Seeing this TS error  
ERROR in

```auto
/frontend/src/pkgs/node_modules/@babylonjs/core/Engines/engine.d.ts
2527:5 Subsequent variable declarations must have the same type. Variable 'XRWebGLLayer' must be of type '{ new (ses
sion: XRSession, context: WebGLRenderingContext | undefined): XRWebGLLayer; prototype: XRWebGLLayer; }', but here has
 type '{ new (session: XRSession, context?: WebGLRenderingContext | undefined): XRWebGLLayer; prototype: XRWebGLLayer
; }'.
    2525 | framebuffer: WebGLFramebuffer;
    2526 | }
  > 2527 | var XRWebGLLayer: {
         | ^
    2528 | prototype: XRWebGLLayer;
    2529 | new(session: XRSession, context?: WebGLRenderingContext): XRWebGLLayer;
    2530 | };

```

Any ideas?

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [August 26, 2019, 4:24pm UTC](https://forum.babylonjs.com/t/using-preview-getting-ts-errors/5290/2 "2019-08-26T16:24:19Z")

</div>

Are you importing a webXR type definition somewhere?

---

<div class="post-metadata">

**Author:** ![delaneyj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/delaneyj/32/3148_2.png) [@delaneyj](https://forum.babylonjs.com/u/delaneyj)\
**Post date:** [August 26, 2019, 4:27pm UTC](https://forum.babylonjs.com/t/using-preview-getting-ts-errors/5290/3 "2019-08-26T16:27:23Z")

</div>

No, search the codebase and don’t see ‘webXR’ anywhere. Here are my devDependicies if that helps

```auto
 "devDependencies": {
    "@babylonjs/core": "^4.1.0-alpha.16",
    "@babylonjs/inspector": "^4.1.0-alpha.16",
    "@babylonjs/loaders": "^4.1.0-alpha.16",
    "@babylonjs/materials": "^4.1.0-alpha.16",
    "@babylonjs/serializers": "^4.1.0-alpha.16",
    "@fortawesome/fontawesome-pro": "^5.10.1",
    "@lifeomic/attempt": "^3.0.0",
    "@types/animejs": "^2.0.2",
    "@types/faker": "^4.1.5",
    "@types/lodash": "^4.14.137",
    "@types/node": "^12.7.1",
    "@types/node-emoji": "^1.8.1",
    "@types/splitpanes": "^1.0.0",
    "@vue/cli-plugin-babel": "^3.10.0",
    "@vue/cli-plugin-eslint": "^3.10.0",
    "@vue/cli-plugin-pwa": "^3.10.0",
    "@vue/cli-plugin-typescript": "^3.10.0",
    "@vue/cli-service": "^3.10.0",
    "@vue/eslint-config-prettier": "^5.0.0",
    "@vue/eslint-config-typescript": "^4.0.0",
    "animejs": "^3.1.0",
    "axios": "^0.19.0",
    "babel-eslint": "^10.0.1",
    "core-js": "^2.6.5",
    "deepmerge": "^4.0.0",
    "eslint": "^5.16.0",
    "eslint-plugin-prettier": "^3.1.0",
    "eslint-plugin-vue": "^5.0.0",
    "faker": "^4.1.0",
    "fibers": "^4.0.1",
    "lint-staged": "^8.1.5",
    "lodash": "^4.17.15",
    "loglevel": "^1.6.3",
    "long": "^4.0.0",
    "milsymbol": "^2.0.0",
    "moment": "^2.24.0",
    "node-emoji": "^1.10.0",
    "npm": "^6.10.3",
    "prettier": "^1.18.2",
    "protobufjs": "^6.8.8",
    "register-service-worker": "^1.6.2",
    "sass": "^1.22.9",
    "sass-loader": "^7.1.0",
    "splitpanes": "^1.14.2",
    "typeface-roboto": "0.0.54",
    "typeface-roboto-condensed": "0.0.54",
    "typeface-roboto-mono": "0.0.54",
    "typescript": "^3.4.3",
    "vue": "^2.6.10",
    "vue-class-component": "^7.0.2",
    "vue-cli-plugin-vuetify": "^0.6.1",
    "vue-property-decorator": "^8.1.0",
    "vue-router": "^3.0.3",
    "vue-template-compiler": "^2.6.10",
    "vuetify": "^2.0.0",
    "vuetify-loader": "^1.2.2",
    "vuex": "^3.0.1",
    "vuex-class-component": "^1.9.0",
    "webpack": "^4.39.1",
    "worker-loader": "^2.0.0"
  },

```

in fact the only place `xr` shows up in the codebase is in engine.d.ts and some yarn.lock hashes (xR,Xr)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [August 26, 2019, 4:31pm UTC](https://forum.babylonjs.com/t/using-preview-getting-ts-errors/5290/4 "2019-08-26T16:31:52Z")

</div>

which version of typescript? (pinging @sebavan)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [August 26, 2019, 4:34pm UTC](https://forum.babylonjs.com/t/using-preview-getting-ts-errors/5290/5 "2019-08-26T16:34:21Z")

</div>

> [@delaneyj](#):
>
> XRSession

(just in case can you delete your node\_modules folder) ?

---

<div class="post-metadata">

**Author:** ![delaneyj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/delaneyj/32/3148_2.png) [@delaneyj](https://forum.babylonjs.com/u/delaneyj)\
**Post date:** [August 26, 2019, 4:37pm UTC](https://forum.babylonjs.com/t/using-preview-getting-ts-errors/5290/6 "2019-08-26T16:37:19Z")

</div>

> [@delaneyj](#):
>
> R

Yeah I mentioned at the top I deleted the node\_modules, also tried yarn.lock hoping it was a caching issue.

@Deltakosh typescript 3.5.3

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [August 26, 2019, 5:04pm UTC](https://forum.babylonjs.com/t/using-preview-getting-ts-errors/5290/7 "2019-08-26T17:04:18Z")

</div>

Could you share your project ???

This would be way simpler to troubleshoot.

---

<div class="post-metadata">

**Author:** ![delaneyj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/delaneyj/32/3148_2.png) [@delaneyj](https://forum.babylonjs.com/u/delaneyj)\
**Post date:** [August 26, 2019, 5:55pm UTC](https://forum.babylonjs.com/t/using-preview-getting-ts-errors/5290/8 "2019-08-26T17:55:50Z")

</div>

@sebavan I sent you a pm about this.

---

<div class="post-metadata">

**Author:** ![delaneyj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/delaneyj/32/3148_2.png) [@delaneyj](https://forum.babylonjs.com/u/delaneyj)\
**Post date:** [August 26, 2019, 6:05pm UTC](https://forum.babylonjs.com/t/using-preview-getting-ts-errors/5290/9 "2019-08-26T18:05:54Z")

</div>

So in trying to find a way to zip up and send the project I found that one of our local libs is symlink’d in and it was using `4.0.3`. For future ludites, make sure ALL versions match or your going to have a bad day. Thank you @Deltakosh and @sebavan!

Is there a RubberDucky award for @sebavan?

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [August 26, 2019, 6:12pm UTC](https://forum.babylonjs.com/t/using-preview-getting-ts-errors/5290/10 "2019-08-26T18:12:47Z")

</div>

So glad it is this as I was really running out of ideas 🙂

---

<div class="post-metadata">

**Author:** ![delaneyj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/delaneyj/32/3148_2.png) [@delaneyj](https://forum.babylonjs.com/u/delaneyj)\
**Post date:** [August 26, 2019, 6:13pm UTC](https://forum.babylonjs.com/t/using-preview-getting-ts-errors/5290/11 "2019-08-26T18:13:06Z")

</div>

Symlinks are a hell of a drug
