Meteor 1.6 production app suddenly failing in Safari 10

I’m getting this error, and a completely blank page. It doesn’t happen locally, and only seems to happen in production (or running as meteor --production). I don’t even know where to begin with this, but it seems Meteor is breaking something during minification. Does anyone have any ideas?

(upgrading Meteor is not an option… tried that once, for kicks, and it seems to break my entire application, so I’m stuck at 1.6)

1 Like

Never mind, fixed it with rm -rf node_modules; meteor yarn then a re-deploy. Typical frail Meteor bundles.

Meteor itself has nothing to do with it. Most likely a Safari update has surfaced a bug in UglifyJS. Which you can fix by updating your Meteor app. Or use the Safari 10 option in the minification options, like here: Cannot declare a let variable twice: 'e'

I would say it is Meteor in this case. If the deployed app is failing, and the only thing I do to correct it is removing node_modules, running meteor yarn, then re-deploying, and that fixes it… it was Meteor.

I’ve experienced this before on a handful of occasions.

I think this is a common misunderstanding. When you meteor npm or meteor yarn the only thing Meteor does is to ensure that its Node version is being used. That’s it. The fact that deleting node_modules and reinstalling fixed the problem is the proof that one of your dependencies was causing the problem, and not Meteor.

2 Likes

Because of the keyboard. He typed everything on it.
Just kidding.

1 Like

This is one of two recurring issues I’ve had with deployments. The other is when everything works fine locally (even with meteor --production), but then deploying it somehow bungles minification and the deployed version craps out. If you look at the GitHub issues history, there have been a number of problems surrounding uglify in the past.

The bottom line is, none of my dependencies have changed since March. Everything has been running and deploying fine, until one day (recently, in the past week or so) a deployment rolled out that broke the app completely for all Safari 9 & 10 users. So hopefully you can understand my confusion and frustration.

I can’t speak to the latest versions of Meteor… I’m sure they’re much improved. Unfortunately I’m stuck at 1.6 because if I try to upgrade to the latest, my app completely breaks.

I understand your frustration. But I am convinced that Meteor itself does not have anything to do with what looks like a Node.js dependency management issue. Try this, if you didn’t already: run meteor npm shrinkwrap. As opposed to package-lock.json, this one guarantees that whatever the environment and whenever you run meteor npm install, the bundle will always have exactly the same version of all dependencies.

As a matter of fact, this was one of the practices recommended in the Meteor Guide. Nowadays, the guide even suggests using Shrinkpack, which offers better results that shrinkwrap alone.

1 Like

Thanks for that tip, I’ll keep it in mind next time!