Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load Meteor site in Safari/Firefox (Works fine in Chrome/Edge) #7474

Closed
Nexus7 opened this issue Jul 26, 2016 · 4 comments
Closed

Comments

@Nexus7
Copy link

Nexus7 commented Jul 26, 2016

Hey all,

We are having a serious production issue with our Meteor 1.3 (and now 1.4) application when trying to access it from Safari or Firefox. The current production version of our application works fine under Meteor 1.2.1 on both Chrome and Safari.

We are now using version 1.4 of Meteor and the following are a sample of the many 'undefined' errors we see in the browser console:

[Error] SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.
    (anonymous function) (modules.js:69842)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
    (anonymous function) (jquery.js:17)
    global code (jquery.js:10421)
[Error] TypeError: undefined is not an object (evaluating 'Package.jquery.$')
    (anonymous function) (twbs_bootstrap.js:17)
    global code (twbs_bootstrap.js:2401)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
    (anonymous function) (promise.js:17)
    global code (promise.js:581)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
    (anonymous function) (ecmascript-runtime.js:17)
    global code (ecmascript-runtime.js:2855)
[Error] TypeError: undefined is not an object (evaluating 'Package['ecmascript-runtime'].Symbol')
    (anonymous function) (babel-compiler.js:7)
    global code (babel-compiler.js:17)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
    (anonymous function) (babel-runtime.js:17)
    global code (babel-runtime.js:1241)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
    (anonymous function) (random.js:18)
    global code (random.js:355)
[Error] TypeError: undefined is not an object (evaluating 'Package.random.Random')
    (anonymous function) (mongo-id.js:19)
    global code (mongo-id.js:142)
[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['mongo-id'].MongoID')
    (anonymous function) (minimongo.js:23)
    global code (minimongo.js:3877)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
    (anonymous function) (check.js:17)
    global code (check.js:613)
[Error] TypeError: undefined is not an object (evaluating 'Package.random.Random')
    (anonymous function) (retry.js:18)
    global code (retry.js:110)
[Error] TypeError: undefined is not an object (evaluating 'Package.check.check')
    (anonymous function) (ddp-common.js:17)
    global code (ddp-common.js:493)
[Error] TypeError: undefined is not an object (evaluating 'Package['ecmascript-runtime'].Symbol')
    (anonymous function) (reload.js:18)
    global code (reload.js:309)
[Error] TypeError: undefined is not an object (evaluating 'Package.check.check')
    (anonymous function) (ddp-client.js:17)
    global code (ddp-client.js:4983)
[Error] TypeError: undefined is not an object (evaluating 'Package['ddp-client'].DDP')
    (anonymous function) (ddp.js:7)
    global code (ddp.js:20)
[Error] TypeError: undefined is not an object (evaluating 'Package.minimongo.LocalCollection')
    (anonymous function) (allow-deny.js:18)
    global code (allow-deny.js:536)
[Error] TypeError: undefined is not an object (evaluating 'Package['allow-deny'].AllowDeny')
    (anonymous function) (mongo.js:17)
    global code (mongo.js:908)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
    (anonymous function) (reactive-dict.js:21)
    global code (reactive-dict.js:375)
[Error] TypeError: undefined is not an object (evaluating 'Package['reactive-dict'].ReactiveDict')
    (anonymous function) (session.js:18)
    global code (session.js:98)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
    (anonymous function) (logging.js:19)
    global code (logging.js:2554)
[Error] TypeError: undefined is not an object (evaluating 'Package['mongo-id'].MongoID')
    (anonymous function) (observe-sequence.js:19)
    global code (observe-sequence.js:397)
[Error] TypeError: undefined is not an object (evaluating 'Package.jquery.$')
    (anonymous function) (blaze.js:17)
    global code (blaze.js:3841)
[Error] TypeError: undefined is not an object (evaluating 'Package.blaze.Blaze')
    (anonymous function) (spacebars.js:20)
    global code (spacebars.js:335)
[Error] TypeError: undefined is not an object (evaluating 'Package.random.Random')
    (anonymous function) (localstorage.js:17)
    global code (localstorage.js:93)
[Error] TypeError: undefined is not an object (evaluating 'Package.random.Random')
    (anonymous function) (accounts-base.js:20)
    global code (accounts-base.js:1260)
[Error] TypeError: undefined is not an object (evaluating 'Package.random.Random')
    (anonymous function) (srp.js:17)
    global code (srp.js:1445)
[Error] TypeError: undefined is not an object (evaluating 'Package['accounts-base'].Accounts')
    (anonymous function) (accounts-password.js:17)
    global code (accounts-password.js:307)
[Error] TypeError: undefined is not an object (evaluating 'Package['accounts-base'].Accounts')
    (anonymous function) (alanning_roles.js:18)
    global code (alanning_roles.js:961)
[Error] TypeError: undefined is not an object (evaluating 'Package.blaze.Blaze')
    (anonymous function) (ui.js:7)
    global code (ui.js:25)
[Error] TypeError: undefined is not an object (evaluating 'Package.spacebars.Spacebars')
    (anonymous function) (naxio_flash.js:19)
    global code (naxio_flash.js:272)
[Error] TypeError: undefined is not an object (evaluating 'Package.blaze.Blaze')
    (anonymous function) (templating.js:18)
    global code (templating.js:256)
[Error] TypeError: undefined is not an object (evaluating 'Package.templating.Template')
    (anonymous function) (lbee_moment-helpers.js:19)
    global code (lbee_moment-helpers.js:433)
[Error] TypeError: undefined is not an object (evaluating 'Package.check.check')
    (anonymous function) (aldeed_simple-schema.js:20)
    global code (aldeed_simple-schema.js:3142)
[Error] TypeError: undefined is not an object (evaluating 'Package['aldeed:simple-schema'].SimpleSchema')
    (anonymous function) (aldeed_collection2-core.js:17)
    global code (aldeed_collection2-core.js:704)
[Error] TypeError: undefined is not an object (evaluating 'Package['aldeed:collection2-core'].Collection2')
    (anonymous function) (aldeed_schema-index.js:17)
    global code (aldeed_schema-index.js:110)
[Error] TypeError: undefined is not an object (evaluating 'Package['aldeed:collection2-core'].Collection2')
    (anonymous function) (aldeed_schema-deny.js:17)
    global code (aldeed_schema-deny.js:67)
[Error] TypeError: undefined is not an object (evaluating 'Package['aldeed:collection2-core'].Collection2')
    (anonymous function) (aldeed_collection2.js:7)
    global code (aldeed_collection2.js:18)
[Error] TypeError: undefined is not an object (evaluating 'Package.templating.Template')
    (anonymous function) (tomi_upload-jquery.js:18)
    global code (tomi_upload-jquery.js:3328)
[Error] TypeError: undefined is not an object (evaluating 'Package.jquery.$')
    (anonymous function) (jonblum_jquery-cropper.js:17)
    global code (jonblum_jquery-cropper.js:3031)
[Error] TypeError: undefined is not an object (evaluating 'Package.check.check')
    (anonymous function) (edgee_slingshot.js:18)
    global code (edgee_slingshot.js:589)
[Error] TypeError: undefined is not an object (evaluating 'Package.templating.Template')
    (anonymous function) (mrgalaxy_stripe.js:7)
    global code (mrgalaxy_stripe.js:28)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
    (anonymous function) (http.js:19)
    global code (http.js:345)
[Error] TypeError: undefined is not an object (evaluating 'Package.jquery.$')
    (anonymous function) (amplify.js:17)
    global code (amplify.js:880)
[Error] TypeError: undefined is not an object (evaluating 'Package.jquery.$')
    (anonymous function) (u2622_persistent-session.js:17)
    global code (u2622_persistent-session.js:553)
[Error] TypeError: undefined is not an object (evaluating 'Package.templating.Template')
    (anonymous function) (miro_mailchimp.js:17)
    global code (miro_mailchimp.js:250)
[Error] TypeError: undefined is not an object (evaluating 'Package.mongo.Mongo')
    (anonymous function) (meteorhacks_search-source.js:20)
    global code (meteorhacks_search-source.js:302)
[Error] TypeError: undefined is not an object (evaluating 'Package['reactive-dict'].ReactiveDict')
    (anonymous function) (kadira_flow-router.js:20)
    global code (kadira_flow-router.js:2720)
[Error] TypeError: undefined is not an object (evaluating 'Package.blaze.Blaze')
    (anonymous function) (kadira_blaze-layout.js:17)
    global code (kadira_blaze-layout.js:225)
[Error] TypeError: undefined is not an object (evaluating 'Package.check.check')
    (anonymous function) (zimme_active-route.js:17)
    global code (zimme_active-route.js:306)
[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:182)
[Error] TypeError: undefined is not an object (evaluating 'Package.jquery.$')
    (anonymous function) (harrison_papa-parse.js:17)
    global code (harrison_papa-parse.js:44)
[Error] ReferenceError: Can't find variable: Papa
    (anonymous function) (evaisse_csv.js:40)
    (anonymous function) (evaisse_csv.js:44)
    (anonymous function) (evaisse_csv.js:70)
    global code (evaisse_csv.js:82)
[Error] TypeError: undefined is not an object (evaluating 'Package['evaisse:csv'].CSV')
    (anonymous function) (clinical_csv.js:17)
    global code (clinical_csv.js:420)
[Error] TypeError: undefined is not an object (evaluating 'Package.jquery.$')
    (anonymous function) (chrismbeckett_toastr.js:17)
    global code (chrismbeckett_toastr.js:485)
[Error] TypeError: undefined is not an object (evaluating 'Package.mongo.Mongo')
    (anonymous function) (ongoworks_security.js:17)
    global code (ongoworks_security.js:356)
[Error] TypeError: undefined is not an object (evaluating 'Package.mongo.Mongo')
    (anonymous function) (vsivsi_job-collection.js:18)
    global code (vsivsi_job-collection.js:3160)
[Error] TypeError: undefined is not an object (evaluating 'Package['ddp-client'].DDP')
    (anonymous function) (livedata.js:7)
    global code (livedata.js:24)
[Error] TypeError: undefined is not an object (evaluating 'Package['ddp-client'].DDP')
    (anonymous function) (meteorhacks_meteor-down.js:17)
    global code (meteorhacks_meteor-down.js:45)
[Error] TypeError: undefined is not an object (evaluating 'Package.jquery.$')
    (anonymous function) (jesperwe_bootstrap-select.js:17)
    global code (jesperwe_bootstrap-select.js:45)
[Error] TypeError: undefined is not an object (evaluating 'Package.check.check')
    (anonymous function) (tunifight_loggedin-mixin.js:17)
    global code (tunifight_loggedin-mixin.js:86)
[Error] TypeError: undefined is not an object (evaluating 'Package.check.check')
    (anonymous function) (mdg_validated-method.js:17)
    global code (mdg_validated-method.js:189)
[Error] TypeError: undefined is not an object (evaluating 'Package.jquery.$')
    (anonymous function) (ctjp_meteor-intl-tel-input.js:17)
    global code (ctjp_meteor-intl-tel-input.js:1928)
[Error] ReferenceError: Can't find variable: jQuery
    (anonymous function) (pascoual_bootstrap-contextmenu.js:238)
    (anonymous function) (pascoual_bootstrap-contextmenu.js:242)
    (anonymous function) (pascoual_bootstrap-contextmenu.js:246)
    global code (pascoual_bootstrap-contextmenu.js:253)
[Error] TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
    (anonymous function) (webapp.js:18)
    global code (webapp.js:70)
[Error] TypeError: undefined is not an object (evaluating 'Package.retry.Retry')
    (anonymous function) (autoupdate.js:19)
    global code (autoupdate.js:206)
[Error] TypeError: undefined is not an object (evaluating 'Package.jquery.$')
    global code (global-imports.js:3)
[Error] ReferenceError: Can't find variable: meteorInstall
    global code (app.js:1)
[Error] TypeError: undefined is not an object (evaluating 'Package['accounts-base'].Accounts')
    (anonymous function) (service-configuration.js:17)
    global code (service-configuration.js:77)
[Error] TypeError: undefined is not an object (evaluating 'Package.check.check')
    (anonymous function) (mdg_validation-error.js:17)
    global code (mdg_validation-error.js:99)

However we don't see any of these issues in Chrome or even Microsoft Edge browser... Any ideas please?

Thanks
Rick
screen shot 2016-07-26 at 12 12 10 pm

@Nexus7 Nexus7 changed the title Unable to load Meteor site in Safari/Firefox (Works fine in Chrome) - Unable to load Meteor site in Safari/Firefox (Works fine in Chrome/Edge) Jul 26, 2016
@Nexus7
Copy link
Author

Nexus7 commented Jul 26, 2016

Ok, looks like I have found the source of this error in one of our npm packages that we are using. In the index.js of the package it has a "use strict" at the top of the file and then uses the const keyword in the file after that. It seems that this causes issues with Safari so for now we are reverting back a couple of commits on this npm package to before they introduced this change...

Hope that helps anyone else who has this problem...

Cheers
Rick

@Nexus7 Nexus7 closed this as completed Jul 26, 2016
@cunneen
Copy link

cunneen commented Oct 26, 2016

I had one (one!) package where I'd forgotten to add api.use('ecmascript') in the package.js file. This resulted in similar errors in phantomjs.

TypeError: undefined is not an object (evaluating 'Package['my-package'].MyObject')

@jntme
Copy link

jntme commented Mar 9, 2019

Just had the same issue. Deleted cookies & other data in the browser and it worked again, no idea why.

@Gwened
Copy link

Gwened commented May 2, 2019

For the record, I had a very similar issue after upgrading to Meteor 1.7.
The app was working fine on current Chrome, Firefox, but neither on Safari Desktop <11 and Safari on latest iOS <11.3 nor on Edge 18 or on Samsung Internet on my Android phone.

Totally blank page, and none of my client code was run.
The first error line before the "TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')" was SyntaxError: Unexpected identifier: 'index' in modules.js, on the line let index = 0.
I tried to use the new function setMinimumBrowserVersions() to make sure the non-working versions of Safari were treated as 'legacy', without any success.

In the Safari debugger, I found out that the error was from browser.js in the npm module 'debug', which was a dependency of 'needle' which was a dependency of 'node-pre-gyp' which was dependency of... 'bcrypt'. It turns out I had installed the bcrypt package to get rid of the message that my server always displayed at startup:
Note: you are using a pure-JavaScript implementation of bcrypt. While this implementation will work correctly, it is known to be approximately three times slower than the native implementation. In order to use the native implementation instead, run meteor npm install --save bcrypt

Removing bcrypt (and getting that message back) fixed the issue on the legacy browsers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants