Hi,
I decided to test my website on an older version of Safari (assuming that a lot of potential users may be using that on their iPhone or iPad).
My site doesn’t load. It returns this error:
This error is thrown in the console when loading the live site on Safari 11.0.1. I have not been able to replicate the issue locally as I cannot install the older version of Safari. Opening the file with this error in does not provide much more context as it’s the main JS file:
The error suggests it’s an issue with browser compatibility - specifically the spread operator.
I managed to open the local development server on an iOS simulator running Safari 11.0.1 but it returned lots of errors. It returned the same error but instead seemed to be related to the stripe
package (the getOptionsFromArgs
function is Stripe-related):
I followed this guide to ensure the Stripe node_module was recompiled. I deployed again. I still get the same error.
My next assumption was that this issue could be solved by adding / tweaking some Babel configuration to ensure spread operators are transpiled properly.
Unfortunately, I have been down a rabbit hole of trying to figure out how to use Babel, how to use its plugins and how to use it with Meteor.
- Do I just add Babel plugins as Meteor packages?
- Do they need to be added as NPM packages?
- Do I need to create a
.babelrc
file or does Meteor handle it once they’re installed? - Other than a spread operator plugin, how do I know which other plugins I need?
- Which spread operator plugin do I need? There seem to be several different ones.
My Meteor version is 1.11.1. React@16.13.1. I can provide the list of Meteor & NPM packages if it’s helpful.
I’d appreciate any help - even the slightest bit of guidance on how to properly use Babel (I couldn’t find many resources on using Meteor with Babel specifically).