[BUG] Stuck "Loading..." overlay and JS error "Stripe is not defined" when assets built with NODE_ENV=production
#1060
Labels
bug
Something isn't working
On the
main
branch, when I pre-build the assets withrm -rf public/packs && bin/rake assets:precompile
, the Houdini dashboard get stuck with a greyed out "Loading..." overlay and the following JS console errors:If instead I
rm -rf public/packs
and run up the development server and let it build the assets, the dashboard loads with no issues. Similarly no issues if Irm -rf public/packs && NODE_ENV=development bin/rake assets:precompile
. The difference between theThe seems independent of whether I'm running the development server or the production server (with removed font-assets and
config.reload_routes = false
as per #1046 and #1054 to allow production to start).The
page__strip_wrapper
JS file whereStripe
is defined is being loaded, as shown in the above screenshot and it seems to be loaded before the error occurs. It seems that either thepage__strip_wrapper
JS isn't running or is being broken somehow by the production Webpack build process. I tried adding aconsole.log('Hello from Stripe!')
at the bottom ofapp/javascript/legacy/stripe_wrapper/index.es6
and rebuilding. The console message showed up for the inline development build, but not for theassets:precompile
build.I found that removing the
environment.SplitChunks
block fromconfig/webpack/production.js
and building withrm -rf public/packs && bin/rake assets:precompile
also works, so the issue would appear to be related to chunking.The text was updated successfully, but these errors were encountered: