Edge and IE lose context to 'Window' with webpack-example
See original GitHub issueObserve
Clone
https://github.com/AnalyticalGraphicsInc/cesium-webpack-example- Replace cesium declaration in the
package.json
: Replace this:"dependencies": { "cesium": "http://cesium-dev.s3-website-us-east-1.amazonaws.com/cesium/no-import-meta/cesium-1.62.0-no-import-meta32711.tgz" },
with:"dependencies": { "cesium": "^1.63.1" },
- Run
npm install
- Run
npm start
- Navigate to
localhost:8080
using IE, Edge, Firefox, and Chrome. - Observe the following: IE & Edge report a Web GL problem. FireFox and Chrome has no issues.
Error in IE & Edge dev console:
Error constructing CesiumWidget. Visit a href="http://get.webgl.org">http://get.webgl.org/a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below: TypeError: Invalid calling object TypeError: Invalid calling object at requestAnimationFramePolyFill (eval code:68:9) at startRenderLoop (eval code:93:9) at useDefaultRenderLoop.set (eval code:549:25) at CesiumWidget (eval code:354:13) at Viewer (eval code:417:9) at componentDidMount (eval code:65:9) at wrappedMethod (eval code:704:7) at commitLifeCycles (eval code:21963:13) at commitLayoutEffects (eval code:25287:7) at callCallback (eval code:363:9)
Work Around
Edit requestAnimationFramePolyFill
function in node_module code:
cesium/Source/Core/requestAnimationFrame.js
replace return implementation(callback)
with:
var boundImplementation = implementation.bind(window);
return boundImplementation(callback);
`
This works because the context within requestAnimationFrame
is lost for some reason before function call.
My Browser Versions
Edge: 41.16299.1419.0 EdgeHTML 16.16299
IE: 11.1451.16299.0CO Update Versions: 11.0.155
Chrome: 78.0.3904.97
Firefox: 68.2.0esr
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Thanks for posting the exact steps to reproduce @e-dong. I’m marking this as a bug here until we can verify if this is an issue with the webpack example perhaps missing something in the build step or an issue that should be resolved in CesiumJS itself.
Closing this due to the fact that we’ve dropped support for IE, and https://github.com/CesiumGS/cesium-webpack-example has since been updated.
@e-dong If you are still seeing this issue when building with the latest recommendations for webpack, please open an issue in https://github.com/CesiumGS/cesium-webpack-example. Thanks!