I've spent a while debugging now and narrowed it down to the Stripe module.
So I'm currently forced to work offline every now and again, and noticed that my Nuxt app seems to just stop during bootstrapping clientside.
After stepping through the code with the debugger, I arrived at the loadStripe function exported by the stripe client. Here, the script can't be loaded, and it rejects the promise with an error. This all makes sense from Stripe's perspective, but it doesn't work for Nuxt.
I propose catching the error in the plugin function and setting the Stripe instance to null or similar: while Stripe of course can't work offline, this should only cause an error if we actually attempt to make calls to its API.
Otherwise, there's nothing we can do to catch the error and recover from it.
As this doesn't only affect developer mode but also PWAs without network access or outages, it'd make sense to handle offline mode.
I've spent a while debugging now and narrowed it down to the Stripe module.
So I'm currently forced to work offline every now and again, and noticed that my Nuxt app seems to just stop during bootstrapping clientside.
After stepping through the code with the debugger, I arrived at the
loadStripe
function exported by the stripe client. Here, the script can't be loaded, and it rejects the promise with an error. This all makes sense from Stripe's perspective, but it doesn't work for Nuxt.I propose catching the error in the plugin function and setting the Stripe instance to
null
or similar: while Stripe of course can't work offline, this should only cause an error if we actually attempt to make calls to its API.Otherwise, there's nothing we can do to catch the error and recover from it.
As this doesn't only affect developer mode but also PWAs without network access or outages, it'd make sense to handle offline mode.
I'll happily create a PR if you're interested.