Upgrade to v3.6.7, admin.min.js 404
-
In Docker, I upgraded to v3.6.7, rebuilt everything, and admin is broken.
The error in console is that "Uncaught ReferenceError: $ is not defined"
Looking at the network panel, /assets/admin.min.js is not found.
In what conditions would this happen?
I'm debugging the build but it seems like the build should emit failure states instead of ploughing forward despite critical assets not being created.
-
It was showing successful builds in the pretty-printed list (sorry, I lost the screen),
then I believe this is the minification step, the webpack step, was failing based on not finding different node_modules, which turned out to be child modules like highlight.js, which are included by other packages. The child modules are apparently implicitly required and then included in client scripts.
pnpm, which I'm using, nests its modules by default, as in:
node_modules/parent_module/node_module/child_module
so all of the child modules need to be hoisted by putting this in .npmrc
node-linker=hoisted
so now the node_modules tree is
node_modules/parent_module
node_module/child_moduleWhy this wasn't triggered before, I have no idea.
My last question now is how can I ensure that the build exits with a failure code in any cases like this? This may have all been designed with prioritizing getting the server back up, but this is not ideal behavior for builds like docker, where it only replaces the running instance when the new instance builds correctly.
I'm probably going to put in something terrible like this into Dockerfile, but this is pretty hacky:
RUN for file in admin.min.js etc etc; do \ if [ ! -f "$file" ]; then \ echo "$file not found!" && exit 1; \ fi; \ done