Caused by Webpack clobbering the `Danbooru` variable for unknown reasons when the app/javascript/packs/flash.js pack is loaded. Disabling the output.library option seems to fix it.
Webpack
This directory contains configuration for Webpack. Webpack is used to bundle Javascript and CSS assets in production. In Rails, Webpack is wrapped by Webpacker, a layer that tries to provide sensible defaults for Webpack.