Jump to content

Help! Getting build errors after updating to alpha8


HoloLite
 Share

Recommended Posts

The alpha8 broke my build. Stuff was building and running fine previously up to alpha7.

I am using angular 5 (with webpack internally).

My package.json settings related to bjs:

    "babylonjs": "^3.2.0-alpha8",
    "babylonjs-gui": "^3.2.0-alpha8",
    "babylonjs-inspector": "^3.2.0-alpha8",
    "babylonjs-loaders": "^3.2.0-alpha8",
    "babylonjs-materials": "^3.2.0-alpha8",
    "babylonjs-post-process": "^3.2.0-alpha8",
    "babylonjs-procedural-textures": "^3.2.0-alpha8",
    "cannon": "0.6.2",
    "core-js": "^2.4.1",
    "oimo": "^1.0.9",

Here are the error messages:

ERROR in node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(842,39): error TS2304: Cannot find name 'IAccessor'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(845,47): error TS2304: Cannot find name 'IAnimationChannel'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(850,24): error TS2304: Cannot find name 'AnimationSamplerInterpolation'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(853,47): error TS2304: Cannot find name 'IAnimationSampler'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(856,40): error TS2304: Cannot find name 'IAnimation'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(861,37): error TS2304: Cannot find name 'IBuffer'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(864,41): error TS2304: Cannot find name 'IBufferView'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(867,37): error TS2304: Cannot find name 'ICamera'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(869,36): error TS2304: Cannot find name 'IImage'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(872,39): error TS2304: Cannot find name 'IMaterial'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(877,35): error TS2304: Cannot find name 'IMesh'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(880,44): error TS2304: Cannot find name 'IMeshPrimitive'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(882,35): error TS2304: Cannot find name 'INode'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(895,38): error TS2304: Cannot find name 'ISampler'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(898,36): error TS2304: Cannot find name 'IScene'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(900,35): error TS2304: Cannot find name 'ISkin'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(904,38): error TS2304: Cannot find name 'ITexture'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(906,35): error TS2304: Cannot find name 'IGLTF'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(1000,57): error TS2304: Cannot find name 'ITextureInfo'.
node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts(1035,93): error TS2304: Cannot find name 'IProperty'.


 

Link to comment
Share on other sites

@RaananW

FYI, although I don't access the babylonjs-loaders package directly, I still need to import it so that the gltf image of the controllers will show correctly. I am using WinMR vr btw.

If I remove all references to import 'babylonjs-loaders' in my project, it will build ok, however incorrect controller image (looks like gear vr controller) will show up and it messes up the event handling.

Link to comment
Share on other sites

I don't think there is a gear vr controller model, possible the generic one.

I'm getting all the same errors as well.  Can't put loaders back to alpha7, since STLFileLoader incorrectly implements ISceneLoaderPlugin. :)  I'm trying to add support for daydream controller... not getting far!

edit: if you copy these declarations into your typings it should build:
https://github.com/BabylonJS/Babylon.js/blob/master/dist/babylon.glTF2Interface.d.ts
Cheers.  Think they are just not building the typings correctly in alpha8.

Link to comment
Share on other sites

So,

there is no ETA, we need to discuss this internally and find a proper solution. in the meantime, if you (or anyone else) wants to make it work, please also include babylonjs-seralizers ("babylonjs-serializers": "^3.2.0-alpha8") in your build, you will not see the ts errors again.

 

Link to comment
Share on other sites

  • 3 months later...

I am still running into this problem. I am using Webpack and importing the OBJ file loader like this:
 

import { OBJFileLoader } from 'babylonjs-loaders';

Then using it like this:

 

const res: Response = await this.httpService.get(part.url).toPromise();
        BABYLON.SceneLoader.RegisterPlugin(new OBJFileLoader());
        const objData: string = `${res.text()}`;
        const mesh: any = await BABYLON.SceneLoader.ImportMeshAsync(
          '',
          '',
          `data: ${objData}`,
          this.viewService.scene,
          this.onProgressLoad,
          '.obj'
        );
        console.log(mesh);

The app works and successfully loads the OBJ file but I get a slew of compiler errors:

 

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1069,40): error TS2304: Cannot find name 'IAccessor'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1074,48): error TS2304: Cannot find name 'IAnimationChannel'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1079,24): error TS2304: Cannot find name 'AnimationSamplerInterpolation'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1083,48): error TS2304: Cannot find name 'IAnimationSampler'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1087,41): error TS2304: Cannot find name 'IAnimation'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1093,38): error TS2304: Cannot find name 'IBuffer'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1097,42): error TS2304: Cannot find name 'IBufferView'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1102,38): error TS2304: Cannot find name 'ICamera'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1105,37): error TS2304: Cannot find name 'IImage'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1109,40): error TS2304: Cannot find name 'IMaterial'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1119,36): error TS2304: Cannot find name 'IMesh'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1123,45): error TS2304: Cannot find name 'IMeshPrimitive'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1126,36): error TS2304: Cannot find name 'INode'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1141,39): error TS2304: Cannot find name 'ISampler'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1145,37): error TS2304: Cannot find name 'IScene'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1148,36): error TS2304: Cannot find name 'ISkin'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1153,39): error TS2304: Cannot find name 'ITexture'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1156,36): error TS2304: Cannot find name 'IGLTF'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1349,57): error TS2304: Cannot find name 'ITextureInfo'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1393,93): error TS2304: Cannot find name 'IProperty'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(1,23): error TS2688: Cannot find type definition file for 'babylonjs'.

ERROR in /Users/aboga2/Documents/Work/cmg-prod/node_modules/babylonjs-loaders/babylonjs.loaders.module.d.ts
(2,23): error TS2688: Cannot find type definition file for 'babylonjs-gltf2interface'.
"babylonjs": "^3.2.0",
"babylonjs-loaders": "^3.2.0",
"babylonjs-materials": "^3.2.0-alpha8",
"babylonjs-post-process": "^3.2.0-alpha8",
"babylonjs-serializers": "^3.2.0",
Link to comment
Share on other sites

One more clue here. I'm not sure why, but it can't find those two files listed at the top of the loader definition. I can get it to compile with no errors if I just remove the two references at the top:
 

/// <reference types="babylonjs"/>
/// <reference types="babylonjs-gltf2interface"/>

And then copy the contents of the glTF definition to the top of the loaders module definition. I don't work with definition files too often so I'm not sure what the fix is. We don't want to duplicate that definition info but it doesn't seem to work properly as is. Even though there are these compiler errors, it still works correctly in the browser.

Link to comment
Share on other sites

One more thought. Considering that definition files don't get compiled into source code, is there any benefit to keeping them separated like this? All these definitions could be combined into a single file and this problem could be alleviated. 

Link to comment
Share on other sites

Hi Alex,

is there a reason you are using 3.2.0 alpha? Those errors were already fixed in 3.2.0 (stable) and in our preview releases (3.3.0@preview)

About the definition not changing and why we are doing it the way we do. First - the gltf2interface is used in both the loaders and the serializers. Typescript doesn't like it when something is defined twice. if we add the typings in both packages and you will need both packages, you will have a hard time.

Second - we are trying to serve everyone. If you want to have a "vanilla"typescript project, no npm - you can. if you want to use typescript with umd or es6 - you can. This architecture allows us to stay as flexible as possible. there are a few downsides, that's true, but our users like the flexibility.

Link to comment
Share on other sites

Hmmm, installed from NPM and that's the version that it chose. I'm wondering is there was some funny business in our NPM shrinkwrap that caused it to use that version. I'll dig into this a little more. In the meantime I am using the vanilla version (removed it from package.json) to get our workflow moving again. I'll report back if this was all due to user error ?

EDIT: Yes, that was the cause. Thanks for solving this. 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...