After upgrading Cesium from v1.43 to v1.45, pulling in the glTF Draco compression support, my Webpack build is failing regarding WebAssembly.
After reviewing the PR and issue on GitHub I couldn't really make heads or tails of which way to go here. It sounds like the WebAssembly modules are already built and delivered similarly to the GLSL codes/modules, but possibly there's a build step I need to perform on Cesium now?
Either way, somehow the inclusion of WebAssembly into the mix is tripping up my Webpack build; here are the details (webpack compile):
WARNING in ./node_modules/cesium/Source/ThirdParty/draco_decoder.wasm
Module build failed: TypeError: Cannot read property 'fileLoader' of undefined
at Object.module.exports (/home/nmschulte/map-project/node_modules/file-loader/index.js:14:28)
@ ./node_modules/cesium/Source/ThirdParty sync ^.\/.*$
@ ./node_modules/cesium/Source/ThirdParty/xss.js
@ ./node_modules/cesium/Source/Core/Credit.js
@ ./node_modules/cesium/Source/Core/IonResource.js
@ ./node_modules/cesium/Source/Core/createWorldTerrain.js
@ ./src/cesium/CesiumGlobe.jsx
@ ./src/App.js
@ ./src/index.js
@ multi ./scripts/config/polyfills.js ./src/index.jsWARNING in ./node_modules/cesium/Source/ThirdParty/Shaders/FXAA3_11.glsl
Module build failed: TypeError: Cannot read property 'fileLoader' of undefined
at Object.module.exports (/home/nmschulte/map-project/node_modules/file-loader/index.js:14:28)
@ ./node_modules/cesium/Source/ThirdParty sync ^.\/.*$
@ ./node_modules/cesium/Source/ThirdParty/xss.js
@ ./node_modules/cesium/Source/Core/Credit.js
@ ./node_modules/cesium/Source/Core/IonResource.js
@ ./node_modules/cesium/Source/Core/createWorldTerrain.js
@ ./src/cesium/CesiumGlobe.jsx
@ ./src/App.js
@ ./src/index.js
@ multi ./scripts/config/polyfills.js ./src/index.jsERROR in chunk main [entry]
[name].js
Sync WebAssembly compilation is not yet implemented
Error: Sync WebAssembly compilation is not yet implemented
at moduleTemplate.hooks.content.tap (/home/nmschulte/map-project/node_modules/webpack/lib/wasm/WasmModuleTemplatePlugin.js:17:13)
at SyncWaterfallHook.eval [as call] (eval at create (/home/nmschulte/map-project/node_modules/tapable/lib/HookCodeFactory.js:17:12), <anonymous>:7:16)
at ModuleTemplate.render (/home/nmschulte/map-project/node_modules/webpack/lib/ModuleTemplate.js:49:54)
at modules.map.module (/home/nmschulte/map-project/node_modules/webpack/lib/Template.js:157:28)
at Array.map (<anonymous>)
at Function.renderChunkModules (/home/nmschulte/map-project/node_modules/webpack/lib/Template.js:154:28)
at compilation.mainTemplate.hooks.modules.tap (/home/nmschulte/map-project/node_modules/webpack/lib/JavascriptModulesPlugin.js:86:23)
at SyncWaterfallHook.eval [as call] (eval at create (/home/nmschulte/map-project/node_modules/tapable/lib/HookCodeFactory.js:17:12), <anonymous>:7:16)
at SyncWaterfallHook.lazyCompileHook [as _call] (/home/nmschulte/map-project/node_modules/tapable/lib/Hook.js:35:21)
at MainTemplate.hooks.render.tap (/home/nmschulte/map-project/node_modules/webpack/lib/MainTemplate.js:128:25)
at SyncWaterfallHook.eval [as call] (eval at create (/home/nmschulte/map-project/node_modules/tapable/lib/HookCodeFactory.js:17:12), <anonymous>:7:16)
at SyncWaterfallHook.lazyCompileHook [as _call] (/home/nmschulte/map-project/node_modules/tapable/lib/Hook.js:35:21)
at MainTemplate.render (/home/nmschulte/map-project/node_modules/webpack/lib/MainTemplate.js:327:34)
at Object.render (/home/nmschulte/map-project/node_modules/webpack/lib/JavascriptModulesPlugin.js:66:34)
at Compilation.createChunkAssets (/home/nmschulte/map-project/node_modules/webpack/lib/Compilation.js:1752:29)
at hooks.optimizeTree.callAsync.err (/home/nmschulte/map-project/node_modules/webpack/lib/Compilation.js:933:10)
(webpack config; paths.cesiumSource === '/home/nmschulte/map-project/node_modules/cesium/Source'):
{
// ...
resolve: {
alias: {
'cesium': paths.cesiumSource,
// ...
},
// ...
},
plugins: [
// copy Cesium assets
new CopyWebpackPlugin([
{ from: path.join(paths.cesiumSource, 'Assets'), to: 'Assets' },
{ from: path.join(paths.cesiumSource, 'ThirdParty'), to: 'ThirdParty' },
{ from: path.join(paths.cesiumSource, 'Widgets'), to: 'Widgets' },
{ from: path.join(paths.cesiumSource, 'Workers'), to: 'Workers' },
{ from: path.join(paths.cesiumSource, '../Build/Cesium/ThirdParty/Workers'), to: 'ThirdParty/Workers', force: true },
{ from: path.join(paths.cesiumSource, '../Build/Cesium/Workers'), to: 'Workers', force: true }
]),
// ...
],
// ...
}
Thanks for looking.