Jump to content

Chrome bug?


Richard C
 Share

Recommended Posts

Chrome is returning the following error message Cannot read property 'getExtension' of null which results in Babylon.js not being loaded.

Chrome has recently updated itself (Grrrr) on my machine and I am getting the error message as a result. This error was not fired before the update. I have tried the code in Firefox, IE and a new browser 'Slimjet' (which is based on and built from Chromium)  and do not get the error.

Is it a Chrome thing or something you tech guys need to know about. The Chrome version is 55.0.2883.87 m (64-bit) on Windows10.

Thanks

Richard C

Link to comment
Share on other sites

Thanks Dad72

I have just tried the code on a laptop which also has latest \chrome and Win 10 and all is OK. It works perfectly. I guess I've done something dumb on the desktop machine, because despite clearing cache, re-installing Chrome and updating display drivers I am still getting the same error message.

I'm at a loss now and honestly don't know what to do. Any suggestions, save wiping the disk and starting all again.

Think I shall take dogs for a walk and hope a miracle happens to my machine while I am out ! 

Richard C

Link to comment
Share on other sites

Would be interesting to know, which extension fails on you PC. Do you have a

  • Costom shader ?
  • Shadow map ? 

Can you comment those out, and back again, does it make any difference ? 

Do you using latest Babylonjs 2.5? 

What is the difference between your Laptop and HomePC
http://webglreport.com/ 

https://browserleaks.com/webgl

--> Supported WebGL Extensions

Are you really sure you make a clean install? Many Programs leave a footprint, somewhere. 

 

Link to comment
Share on other sites

Yes, (we probably need a pinned topic on what is expected to report bugs), but you need to run against the max version to get the line number or line of the error.

Also, do you have Chrome's --enable-webgl-draft-extensions flag set.  Please undo if so, and retest.

I suspect it might be related to the ASTC compressed texture extension, which testing for was added in 2.5.  It was not Khronos community approved until a few days after 2.5 went final.  If not, your max line number will tell us what it is.

Link to comment
Share on other sites

@Nabroski @JCPalmer

There is a difference between the two machines as reported by the two webgl sites you give Nabroski. I am continuing to research using those sites and will report back asap. 

JCP  - enable webgl draft extension was not enbled. Colud I ask you please to expand on what I should do specifically to find the max line number you asked for.

Thanks as ever

Richard C

 

Link to comment
Share on other sites

Use the max version of BJS.  Replace the url on the script tag.  Use say "http://cdn.babylonjs.com/2-5/babylon.max.js"

When your page loads, hit f12 like you did to get the error on console tab.  There should be an underlined babylon.max.js:line number.  That is what is wanted.  If you click it will actually bring you to the source line in the max file.  Cut and paste that line.

chrome.PNG

Link to comment
Share on other sites

@Nabroski, I do not know what a 'default' even is with regards to a webgl context. I do not think the argument is optional, especially since it is the first arg.

canvas.getContext("webgl", options)

I can say, unless you are running BJS 2.6._alpha, you are always going be requesting a webgl1 context.  If you look a little further up the engine file, @Deltakosh has un-commented out the request for a webgl2 context that will fallback to webgl1.  I do not see anything breaking with 2.5.

This op has hardware (graphics card), which he does not list.  He shows no line number in Engine where this occurs.  He cannot be helped. I'm out.

Link to comment
Share on other sites

@JCPalmer

@Nabroski

 

Please don't bail out - I have not been doing nothing in the past 48 hours - honest. I wanted to research and try and solve the issues myself before coming back and bothering you further.

Following the reports from the two sites Nabroski suggested, I was set on a course to update drivers especially video drivers. I have a Dell machine and they don't make it easy to update. Then, having updated, webGLreport.com said of Chrome -  webGL1 supported but not enabled. It took a while to find the solution to that one too.

Having done all that, the problem still exists. I have done as JCP asked and the result is: 

Uncaught TypeError: Cannot read property 'getExtension' of null

    at Engine._canRenderToTextureOfType (babylon.max.js:9033)

    at Engine._canRenderToFloatTexture (babylon.max.js:9021)

    at new Engine (babylon.max.js:6609)

    at index.html:32

 

9021

 return this._canRenderToTextureOfType(BABYLON.Engine.TEXTURETYPE_FLOAT, 'OES_texture_float');

9033

var ext = gl.getExtension(extension);

6609

            var renderToFullFloat = this._canRenderToFloatTexture();

 

Please bare in mind that I have run this code on two machines - laptop and pc.

Only the PC fails, the laptop doesn't fail and the result is as expected. I can only assume the issue is machine specific but I would greatly appreciate your input.

thanks Richard C 

Link to comment
Share on other sites

Hello @Richard C

Yes, probably your Graphic cards may handle different textures.

'OES_texture_float' mean a texture with Alpha value. so you try to load a e.g PNG, with RGBA or an conversation for not float texture to a RGBA Shader, -  and at some point it fails. 

this by @Convergence
 http://misc.blicky.net/c2/?id=1&highfps

It fails on my machine with "newer" Chrome. 

Please open your console, can you confirm ?  errors like can load .jpg or js script failed etc.

Link to comment
Share on other sites

Nabroski

No errors as no .jpg being used, just standard Babylon materials.

Interestingly, it does not fail in Microsoft Edge or Firefox.IE11 doesn't display page but there are no error messages.  I have also recently installed slimjet (browser) which is based on Chromium and that doesn't fail either. It is only Chrome that is not playing ball.

Cheers

Richard c

Link to comment
Share on other sites

Ok, first this code was added in 2.5 for a problem in iOS.  First option is to switch to 2.4 as a workaround for the immediate future.  Are you using 2.5 features in your work (just see if 2.4 works to check)?

It looks like whatever Chrome now does, you cannot have a 2nd webgl context on the tempcanvas created inside of _canRenderToTextureOfType() on this graphics card.  My line numbers will be different, as I am only referencing engine.ts, but in line 3127 gl is returned as null.  The next line where gl.getExtension() is called blows up.

I am not sure why a temp context is required, probably to not have to cleanup anything. A check should probably added to ensure that gl is a context and not null, but this is not my code.

You should probably make sure your Display Adapter driver is up to date by right clicking on the Display Adapter & clicking "Update driver software..." in Device Manager.

That is the extent to the triage I can offer.

Btw, @Nabroski I see we are asking for a 'webgl' not a 'webgl1' context.  I saw 'webgl2' was explicitly being asked for first, and the 'l' being so close to '1' in my editor, I read it wrong.  If a browser is going to interpret 'webgl' differently from the past, you would assume they tested this in the real world.

Link to comment
Share on other sites

On 12/18/2016 at 5:03 PM, Nabroski said:


this by @Convergence
 http://misc.blicky.net/c2/?id=1&highfps

It fails on my machine with "newer" Chrome. 

Please open your console, can you confirm ?  errors like can load .jpg or js script failed etc.

Thanks for reporting.. My Chrome claim to be up-to-date (55.0.2883.87 m@Win7) but I don't see any errors? 

Link to comment
Share on other sites

@Convergence

No worries you have maybe a half year 'til the majority of people start to use WebGL 2.0


Firefox 51.0b8 (Release in January ) A lot of Errors your site wont start
Chrome 56 ( Stable February ) -  57.0.2950.4 dev (March.++) Materials fail, but the site starts anyway with artifacts. (No ground, no water)

Threejs has WebGL 2.0 support since 2 years, they already go trough all this, look up in their bugreport.

Basically you have to place a switch in your code, so it has a fallback structure. 

I cant find the link anymore, but Khronos website has a description of it. 

somewhere here

https://www.khronos.org/registry/webgl/specs/latest/2.0/#4.1

@Deltakosh

Link to comment
Share on other sites

@Nabroski

I tried

http://misc.blicky.net/c2/?id=1&highfps

on the offending machine and it works perfectly in Chrome.

I tried to load my script, using Babylon-2.4 as JCP suggested. Still didn't work but at least the error message is different ........... this time it's

"webGL not supported"

So my problem is still a mystery to me. I'm getting somewhat disheartened now. Perhaps I shall prepare a PG for all to see.

cheers

Richard C

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...