Fork me on GitHub
#figwheel-main
<
2023-03-01
>
Luke Zeitlin23:03:22

Hi there folks. Bit of a head-scratcher: when using :advanced optimization settings I am getting a ChunkLoadError: Loading chunk 831 failed. This is preceded by a an error saying that we failed to GET cljs-out/web/831.main_bundle.js. Thesr errors have been introduced by using a https://openlayers.org/en/latest/apidoc/module-ol_source_GeoTIFF.html in the js maps library OpenLayers and, judging from the stack-trace, it is happening while trying to load the tiles of this image. All works fine with optimization set to none. Any thoughts much appreciated. I'll add more info about the error below

👍 2
Luke Zeitlin23:03:59

The GET 404: (here it's coming from cloudfront but the same when running the app locally with optimization). Bit unclear with the minimised var names

main_bundle.js:2          GET  net::ERR_ABORTED 404


l.l	@	main_bundle.js:2
l.f.j	@	main_bundle.js:2
(anonymous)	@	main_bundle.js:2
l.e	@	main_bundle.js:2
e._awaitingDecoder	@	main_bundle.js:2
(anonymous)	@	main_bundle.js:2
St	@	main_bundle.js:2
loadTile_	@	main_bundle.js:2
(anonymous)	@	main_bundle.js:2
(anonymous)	@	main_bundle.js:2
u	@	main_bundle.js:2
loader	@	main_bundle.js:2
load	@	main_bundle.js:2
...

Luke Zeitlin23:03:57

The ChunkLoad error:

Uncaught (in promise) ChunkLoadError: Loading chunk 831 failed.
(error: )
    at l.f.j (main_bundle.js:2:2877032)
    at main_bundle.js:2:2875302
    at Array.reduce (<anonymous>)
    at l.e (main_bundle.js:2:2875280)
    at e._awaitingDecoder (main_bundle.js:2:2813376)
    at new Promise (<anonymous>)
    at new <anonymous> (main_bundle.js:2:2813357)
    at St (main_bundle.js:2:2813206)
    at jt.loadTile_ (main_bundle.js:2:2819549)
    at main_bundle.js:2:2775575

Luke Zeitlin01:03:53

"fixed" by adding a webpack.config.js with:

const webpack = require('webpack');

module.exports = {
  plugins: [
    new webpack.optimize.LimitChunkCountPlugin({
      maxChunks: 1
    })
  ]
};
but I don't love it since it's removing the benefits of chunks.

Luke Zeitlin01:03:24

being caused by geotiff.js which is a dependency of openlayers (on the off chance anyone searches for this)