Meteor app hard crashes while browsing in private mode in Safari


We at Lookback use Meteor for our production app, but today we discovered something:

Our app would show a white page of death if visiting with Safari in private mode.

The console reads:

[Log] You are running a browser with no localStorage or userData support. Logging in from one tab will not cause another tab to be logged in. (debug.js, line 41)

[Error] QuotaExceededError: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota.
	nonreactive (tracker.js, line 527)
	_materializeView (blaze.js, line 1921)
	render (blaze.js, line 2204)
	insert (iron_dynamic-template.js, line 522)
	insert (iron_router.js, line 1632)
	maybeAutoInsertRouter (iron_router.js, line 1622)

Checkout in Safari private.

Something fishy going on in Iron Router (we’re running 1.0.7).

That is, Meteor hard crashes if no localStorage is available, since local storage isn’t available in Safari if in private mode:

Works fine in Chrome and Firefox. Interesting enough, I cannot reproduce this in a vanilla Meteor app.

Has anyone else had this? This seems rather major.

This seem related:

Yep, I linked to that thread.

oh, reading is not my strong side :slight_smile:

I have the same error: when accessed in private mode, my Meteor application crashes, showing an error message:

iron:router Organize your Meteor application.

Is there any solution to this issue?

We had some problems last week with our production app going to white screen on mobile Safari (nothing else). It isn’t necessarily related, but I found that it was a mobile specific package (touch-punch) loading not loading properly.

Removing and re-adding the package fixed the problem. Possibly a package (if not somewhere in your app) is calling localStorage. Might be worth removing it as re-adding?

This is fixed for us now, since we made an audit and checked if localStorage is enabled (not in incognito mode) before using it.

you might ran into this issue: es5-shim breaks app when cookies are not allowed