[SOLVED] Safari only JS syntax errors

Hi All,

I have been coding away on my app in chrome (latest) and not really checking it on other browsers. Now I tried to open ti in Safari and I am getting a long list of JS errors in the console. I googled a bit but its something about using strict mode or similar?

I don’t think I enabled anything in particular in terms of javascript tough, using latest Meteor 1.8.1

[Error] SyntaxError: Duplicate parameter 'text' not allowed in function with default parameter values.
	(anonymous function) (modules.js:16518)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
	(anonymous function) (babel-runtime.js:17)
	Global Code (babel-runtime.js:155)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
	(anonymous function) (promise.js:17)
	Global Code (promise.js:164)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
	(anonymous function) (fetch.js:17)
	Global Code (fetch.js:52)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
	(anonymous function) (dynamic-import.js:17)
	Global Code (dynamic-import.js:527)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
	(anonymous function) (ecmascript-runtime-client.js:17)
	Global Code (ecmascript-runtime-client.js:1366)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
	(anonymous function) (base64.js:17)
	Global Code (base64.js:217)
[Error] TypeError: undefined is not an object (evaluating 'Package.base64.Base64')
	(anonymous function) (ejson.js:17)
	Global Code (ejson.js:872)
[Error] TypeError: undefined is not an object (evaluating 'Package.ejson.EJSON')
	(anonymous function) (diff-sequence.js:17)
	Global Code (diff-sequence.js:321)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
	(anonymous function) (geojson-utils.js:17)
	Global Code (geojson-utils.js:439)
[Error] TypeError: undefined is not an object (evaluating 'Package.ejson.EJSON')
	(anonymous function) (id-map.js:17)
	Global Code (id-map.js:141)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
	(anonymous function) (random.js:17)
	Global Code (random.js:344)
[Error] TypeError: undefined is not an object (evaluating 'Package.ejson.EJSON')
	(anonymous function) (mongo-id.js:17)
	Global Code (mongo-id.js:164)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
	(anonymous function) (ordered-dict.js:17)
	Global Code (ordered-dict.js:287)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
	(anonymous function) (tracker.js:17)
	Global Code (tracker.js:672)
[Error] TypeError: undefined is not an object (evaluating 'Package['diff-sequence'].DiffSequence')
	(anonymous function) (minimongo.js:17)
	Global Code (minimongo.js:4660)
[Error] TypeError: undefined is not an object (evaluating 'Package.ejson.EJSON')
	(anonymous function) (check.js:17)
	Global Code (check.js:637)
[Error] TypeError: undefined is not an object (evaluating 'Package.random.Random')
	(anonymous function) (retry.js:17)
	Global Code (retry.js:106)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
	(anonymous function) (callback-hook.js:17)
	Global Code (callback-hook.js:193)
[Error] TypeError: undefined is not an object (evaluating 'Package.check.check')
	(anonymous function) (ddp-common.js:17)
	Global Code (ddp-common.js:518)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
	(anonymous function) (reload.js:17)
	Global Code (reload.js:266)
[Error] TypeError: undefined is not an object (evaluating 'Package.retry.Retry')
	(anonymous function) (socket-stream-client.js:17)
	Global Code (socket-stream-client.js:3267)
[Error] TypeError: undefined is not an object (evaluating 'Package.check.check')
	(anonymous function) (ddp-client.js:17)
	Global Code (ddp-client.js:2183)
[Error] TypeError: undefined is not an object (evaluating 'Package['ddp-client'].DDP')
	(anonymous function) (ddp.js:14)
	Global Code (ddp.js:23)
[Error] TypeError: undefined is not an object (evaluating 'Package.minimongo.LocalCollection')
	(anonymous function) (allow-deny.js:17)
	Global Code (allow-deny.js:556)
[Error] TypeError: undefined is not an object (evaluating 'Package['allow-deny'].AllowDeny')
	(anonymous function) (mongo.js:17)
	Global Code (mongo.js:879)
[Error] TypeError: undefined is not an object (evaluating 'Package.tracker.Tracker')
	(anonymous function) (reactive-var.js:17)
	Global Code (reactive-var.js:138)
[Error] TypeError: undefined is not an object (evaluating 'Package.random.Random')
	(anonymous function) (localstorage.js:17)
	Global Code (localstorage.js:100)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
	(anonymous function) (jquery.js:17)
	Global Code (jquery.js:11101)
[Error] TypeError: undefined is not an object (evaluating 'Package.tracker.Tracker')
	(anonymous function) (observe-sequence.js:17)
	Global Code (observe-sequence.js:403)
[Error] TypeError: undefined is not an object (evaluating 'Package.tracker.Tracker')
	(anonymous function) (deps.js:14)
	Global Code (deps.js:25)
[Error] TypeError: undefined is not an object (evaluating 'Package.tracker.Tracker')
	(anonymous function) (htmljs.js:17)
	Global Code (htmljs.js:681)
[Error] TypeError: undefined is not an object (evaluating 'Package.jquery.$')
	(anonymous function) (blaze.js:17)
	Global Code (blaze.js:3937)
[Error] TypeError: undefined is not an object (evaluating 'Package.tracker.Tracker')
	(anonymous function) (accounts-base.js:17)
	Global Code (accounts-base.js:1313)
[Error] TypeError: undefined is not an object (evaluating 'Package.random.Random')
	(anonymous function) (srp.js:17)
	Global Code (srp.js:1806)
[Error] TypeError: undefined is not an object (evaluating 'Package['accounts-base'].Accounts')
	(anonymous function) (accounts-password.js:17)
	Global Code (accounts-password.js:327)
[Error] TypeError: undefined is not an object (evaluating 'Package['accounts-base'].Accounts')
	(anonymous function) (service-configuration.js:17)
	Global Code (service-configuration.js:73)
[Error] TypeError: undefined is not an object (evaluating 'Package['observe-sequence'].ObserveSequence')
	(anonymous function) (spacebars.js:17)
	Global Code (spacebars.js:331)
[Error] TypeError: undefined is not an object (evaluating 'Package.blaze.Blaze')
	(anonymous function) (templating-runtime.js:18)
	Global Code (templating-runtime.js:252)
[Error] TypeError: undefined is not an object (evaluating 'Package['templating-runtime'].Template')
	(anonymous function) (templating.js:14)
	Global Code (templating.js:23)
[Error] TypeError: undefined is not an object (evaluating 'Package.tracker.Tracker')
	(anonymous function) (reactive-dict.js:17)
	Global Code (reactive-dict.js:457)
[Error] TypeError: undefined is not an object (evaluating 'Package['reactive-dict'].ReactiveDict')
	(anonymous function) (session.js:17)
	Global Code (session.js:61)
[Error] TypeError: undefined is not an object (evaluating 'Package.tracker.Tracker')
	(anonymous function) (accounts-ui-unstyled.js:17)
	Global Code (accounts-ui-unstyled.js:1990)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
	(anonymous function) (tmeasday_check-npm-versions.js:17)
	Global Code (tmeasday_check-npm-versions.js:1327)
[Error] TypeError: undefined is not an object (evaluating 'Package.mongo.Mongo')
	(anonymous function) (aldeed_collection2-core.js:17)
	Global Code (aldeed_collection2-core.js:6003)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
	(anonymous function) (url.js:17)
	Global Code (url.js:118)
[Error] TypeError: undefined is not an object (evaluating 'Package.url.URL')
	(anonymous function) (http.js:17)
	Global Code (http.js:364)
[Error] TypeError: undefined is not an object (evaluating 'Package.tracker.Tracker')
	(anonymous function) (kadira_flow-router.js:18)
	Global Code (kadira_flow-router.js:2728)
[Error] TypeError: undefined is not an object (evaluating 'Package.blaze.Blaze')
	(anonymous function) (kadira_blaze-layout.js:17)
	Global Code (kadira_blaze-layout.js:221)
[Error] TypeError: undefined is not an object (evaluating 'Package.check.check')
	(anonymous function) (zimme_active-route.js:17)
	Global Code (zimme_active-route.js:297)
[Error] TypeError: undefined is not an object (evaluating 'Package.check.check')
	(anonymous function) (arillo_flow-router-helpers.js:17)
	Global Code (arillo_flow-router-helpers.js:176)
[Error] TypeError: undefined is not an object (evaluating 'Package.mongo.Mongo')
	(anonymous function) (dburles_collection-helpers.js:18)
	Global Code (dburles_collection-helpers.js:55)
[Error] TypeError: undefined is not an object (evaluating 'Package.check.check')
	(anonymous function) (kestanous_herald.js:17)
	Global Code (kestanous_herald.js:747)
[Error] TypeError: undefined is not an object (evaluating 'Package['kestanous:herald'].Herald')
	(anonymous function) (kestanous_herald-email.js:17)
	Global Code (kestanous_herald-email.js:70)
[Error] TypeError: undefined is not an object (evaluating 'Package.check.check')
	(anonymous function) (froatsnook_valid-email.js:17)
	Global Code (froatsnook_valid-email.js:74)
[Error] TypeError: undefined is not an object (evaluating 'Package.ejson.EJSON')
	(anonymous function) (staringatlights_inject-data.js:17)
	Global Code (staringatlights_inject-data.js:148)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
	(anonymous function) (webapp.js:17)
	Global Code (webapp.js:68)
[Error] TypeError: undefined is not an object (evaluating 'Package.webapp.WebApp')
	(anonymous function) (server-render.js:17)
	Global Code (server-render.js:151)
[Error] TypeError: undefined is not an object (evaluating 'Package['staringatlights:inject-data'].InjectData')
	(anonymous function) (staringatlights_fast-render.js:17)
	Global Code (staringatlights_fast-render.js:721)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
	(anonymous function) (okgrow_analytics.js:17)
	Global Code (okgrow_analytics.js:498)
[Error] TypeError: undefined is not an object (evaluating 'Package['reactive-var'].ReactiveVar')
	(anonymous function) (ostrio_logger.js:17)
	Global Code (ostrio_logger.js:450)
[Error] TypeError: undefined is not an object (evaluating 'Package.mongo.Mongo')
	(anonymous function) (ostrio_loggermongo.js:17)
	Global Code (ostrio_loggermongo.js:218)
[Error] TypeError: undefined is not an object (evaluating 'Package.check.check')
	(anonymous function) (ostrio_loggerconsole.js:17)
	Global Code (ostrio_loggerconsole.js:359)
[Error] TypeError: undefined is not an object (evaluating 'Package.tracker.Tracker')
	(anonymous function) (kadira_dochead.js:17)
	Global Code (kadira_dochead.js:293)
[Error] TypeError: undefined is not an object (evaluating 'Package['ddp-client'].DDP')
	(anonymous function) (livedata.js:14)
	Global Code (livedata.js:27)
[Error] TypeError: undefined is not an object (evaluating 'Package.blaze.Blaze')
	(anonymous function) (ui.js:14)
	Global Code (ui.js:27)
[Error] TypeError: undefined is not an object (evaluating 'Package.tracker.Tracker')
	(anonymous function) (autoupdate.js:17)
	Global Code (autoupdate.js:359)
[Error] TypeError: undefined is not an object (evaluating 'Package.mongo.Mongo')
	Global Code (global-imports.js:3)
[Error] ReferenceError: Can't find variable: meteorInstall
	Global Code (app.js:1)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (favicon.ico, line 0)

That first line looks like an error in an npm module, which might be causing a cascade of other errors?

Are you able to look in the dev-tools to work out which module the error is from?

Hi, my answer is not directed to Safari in particular, I don’t really know what is going on there, but I get this type of behavior when I do something wrong … for instance in the client startup. Let’s say that I have some code error, import something wrong… in general a code error that prevents the rest of Meteor loading up. What I usually do is to remove parts of the code from “top” to “bottom” in the order they get loaded and see what is the bad area. If you use React, that is really simple as you could start by removing the whole router or the App which mounts on the html id and so on. You could also do this with a clone of your project and have all NPMs installed from scratch. I would only focus on NPM modules when I made sure my own code is ok.

thanks @paulishca @coagmano I will investigate.

I am using meteor and blaze… I went into client/main.js which loads all the imports (as far as I understand and deleted everything

import '/imports/startup/both';
import '/imports/startup/client';
...

So should I look in NPM modules then?

Solved!

I imported cloudinary the wrong way for Safari, once I imported the ES-5 version explicitly it worked

import  cloudinary        from 'cloudinary/lib-es5/cloudinary';
2 Likes