Using preview getting ts errors

changed package.json from

"@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

    "@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 per @sebavan’s advice I made sure everything was on the preview version.

Seeing this TS error
ERROR in

/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?

Are you importing a webXR type definition somewhere?

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

 "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)

which version of typescript? (pinging @sebavan)

(just in case can you delete your node_modules folder) ?

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

Could you share your project ???

This would be way simpler to troubleshoot.

1 Like

@sebavan I sent you a pm about this.

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?

2 Likes

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

Symlinks are a hell of a drug