App is broken after 0.9.4 update: undefined is not a function in dynamic_template.js:371 - meteor

I had a meteor 0.9.3 app that was working.
I ran meteor update. Now I have a bunch or errors (60 total):
Uncaught TypeError: undefined is not a function dynamic_template.js:371
Uncaught TypeError: Cannot read property 'prototype' of undefined helpers.js:140
Uncaught TypeError: undefined is not a function router.js:61
Uncaught TypeError: Cannot read property 'RouteController' of undefined iron-router-progress.js?2b52a697e5a2fba4ec827721c08cfdd0a5bae508:25
Uncaught TypeError: Cannot read property 'RouteController' of undefined global-imports.js?a26cc176b56b3d2b1df619ec7af99630b0fb6a1f:3
Uncaught ReferenceError: Template is not defined template.about.js?3ead3e2cab8a60252235e31f2533c2179f736294:2
Uncaught ReferenceError: Template is not defined template.register.js?60e4180bd0193951fab290d41493f5036f66240d:2
... 53 more errors:
... mainly "Template is not defined" and "Meteor is not defined"
Line 371 of dynamic_template.js is the following:
UI.registerHelper('DynamicTemplate', Template.__create__('DynamicTemplateHelper', function () {
What's wierd is that if I try to go back with meteor update --release 0.9.3 or 0.9.2, I still have those errors. So I'm stuck, I have to fix those.
Another anoying thing is that everytime I start my meteor server, I get updating package catalog with a progress bar, and my server takes a while (~10s) to start up.
Any ideas?

In 0.9.4 there are changes to the templating API. See HISTORY.md on gihub/meteor/meteor for more details.
The fix for your immediate problem is to replace UI with Template
Template.registerHelper('DynamicTemplate', Template.__create__('DynamicTemplateHelper', function () {

Related

Uncaught TypeError: Cannot read property 'register' of undefined

I'm using pushpad.xyz for push notifications in my wordpress project. I added pushpad code but I get this error which I can't understand.
pushpad.js:292 Uncaught TypeError: Cannot read property 'register' of undefined
at Object.registerServiceWorker (pushpad.js:292)
at Object.init (pushpad.js:261)
at init (pushpad.js:362)
at window.pushpad (pushpad.js:548)
at pushpad.js:551
at Array.forEach (<anonymous>)
at pushpad.js:550
at pushpad.js:553
Could some one explain why I'm getting this error. Because this error is coming only in this wordpress project which I'm running in a virtual machine using vagrant. Is this the reason for the error? If yes how can I fix it?
The relevant line in pushpad.js that raise the error is the following:
navigator.serviceWorker.register(_.options.serviceWorkerPath, { updateViaCache: 'none' });
Thus the error indicates that navigator.serviceWorker is undefined: probably you are using an old or buggy browser version.

Error after install mocha in meteor

I want to make some test to my software, so I follow some tutorial on the internet and find out the package practicalmeteor:mocha. But after install the package and open the local(without writing any test). I receive the error yelling:
socket-stream-client.js:100 Uncaught TypeError: _this._launchConnection is not a function
at new ClientStream (socket-stream-client.js:100)
at new Connection (ddp-client.js:435)
at Object.DDP.connect (ddp-client.js:2340)
at client_convenience.js (ddp-client.js:125)
at fileEvaluate (modules-runtime.js:353)
at require (modules-runtime.js:248)
at client.js (ddp-client.js:54)
at fileEvaluate (modules-runtime.js:353)
at require (modules-runtime.js:248)
at ddp-client.js:2381
ddp.js:14 Uncaught TypeError: Cannot read property 'DDP' of undefined
at ddp.js:14
at ddp.js:23
allow-deny.js:22 Uncaught TypeError: Cannot read property 'DDP' of undefined
at allow-deny.js:22
at allow-deny.js:566
mongo.js:17 Uncaught TypeError: Cannot read property 'AllowDeny' of undefined
at mongo.js:17
at mongo.js:871
accounts-base.js:23 Uncaught TypeError: Cannot read property 'DDP' of undefined
at accounts-base.js:23
at accounts-base.js:1462
service-configuration.js:17 Uncaught TypeError: Cannot read property 'Accounts' of undefined
at service-configuration.js:17
at service-configuration.js:73
accounts-password.js:17 Uncaught TypeError: Cannot read property 'Accounts' of undefined
at accounts-password.js:17
at accounts-password.js:329
accounts-ui-unstyled.js:19 Uncaught TypeError: Cannot read property 'ServiceConfiguration' of undefined
at accounts-ui-unstyled.js:19
at accounts-ui-unstyled.js:2113
meteortoys_toykit.js:26 Uncaught TypeError: Cannot read property 'Mongo' of undefined
at meteortoys_toykit.js:26
at meteortoys_toykit.js:410
msavin_mongol.js:20 Uncaught TypeError: Cannot read property 'Mongo' of undefined
at msavin_mongol.js:20
at msavin_mongol.js:1058
autoupdate.js:20 Uncaught TypeError: Cannot read property 'DDP' of undefined
at autoupdate.js:20
at autoupdate.js:231
practicalmeteor_mocha.js:18 Uncaught TypeError: Cannot read property 'DDP' of undefined
at practicalmeteor_mocha.js:18
at practicalmeteor_mocha.js:13186
livedata.js:14 Uncaught TypeError: Cannot read property 'DDP' of undefined
at livedata.js:14
at livedata.js:27
global-imports.js:3 Uncaught TypeError: Cannot read property 'Mongo' of undefined
at global-imports.js:3
meteor.js:1081 Uncaught Error: Can't find test driver package: practicalmeteor:mocha
at meteor.js:1081
at maybeReady (meteor.js:871)
at HTMLDocument.loadingCompleted (meteor.js:883)
I am using meteor 1.6.1.1
I will put this as an answer because it may still be relevant so new users that came to the same point.
practialmeteor:mocha is a recommended package but not compatible anymore with Meteor >=1.6.1 and the chance is very high that it is not maintained anymore (as you can see on their open gh issues).
Alternative packages include
cultofcoders:mocha
meteortesting:mocha
I've also met such thing so that it really took me some time to figure out.
According to the Meteor Todo App with Angular tutorial, practicalmeteor:mocha package is recommended. And what an interesting thing is that meteortesting:mocha is used in a typical scaffold project.
"scripts": {
"start": "meteor run",
"test": "meteor test --once --driver-package meteortesting:mocha",
"test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha",
"visualize": "meteor --production --extra-packages bundle-visualizer"
},
However, only using cultofcoders:mocha which is forked from practicalmeteor:mocha did work.
meteor remove practicalmeteor:mocha
meteor add cultofcoders:mocha
meteor test --driver-package cultofcoders:mocha
Enjoy coding!

Error after upgraded to Meteor 0.9.1

After upgraded Meteor from 0.9.0.1 to 0.9.1, I got the following errors in console:
Uncaught TypeError: Cannot read property 'registerHelper' of undefined
Uncaught TypeError: Cannot read property 'T9n' of undefined
Uncaught TypeError: Cannot read property 'AccountsEntry' of undefined
Uncaught ReferenceError: Template is not defined
Uncaught ReferenceError: Meteor is not define
Exception in defer callback: ReferenceError: Spacebars is not defined
It seems that the changes are not backwards compatible.
It sounds like you have a package that is not compatible. To check what this is look at your server console.
If you want to brute force your way into getting it to work, git clone the offending package into /packages and it should get it to work (also add it with meteor add xx where xx is the name of the directory in /packages
Additionally rename the following (even though you would not yet have to) to bring it up to date:
UI.registerHelper -> Template.registerHelper
Handlebars.registerHelper -> Template.registerHelper

Meteor Suddenly a lot of packages do not work (possible because of meteor update)

I;ve been developing a quizz app recently and it was working consistently but now suddenly a lot of packages are not defined. A small part of the error log below (this goes on to contain most of the packages)
Uncaught ReferenceError: Package is not defined meteor.js? 7a66be7a03504cd2c18dd47b699e6233b60675ed:21
Uncaught ReferenceError: Package is not defined json.js?e22856eae714c681199eabc5c0710b904b125554:21
Uncaught ReferenceError: Package is not defined ejson.js?9ccd48dbafd805e21408c9eae1061468b3ec1f2f:21
Uncaught ReferenceError: Package is not defined logging.js?
Other interesting errors:
Uncaught ReferenceError: Deps is not defined quiz_list.js?b063b352079e20c9f9485683b352f8482a87fdf4:4
Uncaught ReferenceError: Template is not defined
Does anyone know what is causing this and how I can remedy it? I have tried resetting and updating.
I often get a whole slew of these types of errors as a result of one uncaught exception right at the top. If things don't happen in the right order, then things really don't happen.
Try scrolling right up and seeing if there is a more informative error (not always shown in red in Chrome).

blank screen in meteor with nitrous.io

I've been working on an app in meteor and it's just giving me blank screen however the page title still works.
I had to double check whether it was my app or the box so I backed up my stuff, started a brand new node box and installed meteor by itself and it's giving me the same problem, has anyone else encountered this?
also, i got these errors chrome's console:
Uncaught SyntaxError: Unexpected end of input jquery.js:5903
Uncaught TypeError: Cannot read property '$' of undefined domutils.js:22
Uncaught TypeError: Cannot read property 'DomUtils' of undefined universal-events.js:23
Uncaught TypeError: Cannot read property 'DomUtils' of undefined spark.js:24
Uncaught TypeError: Cannot read property 'Spark' of undefined preserve-inputs.js:23
Uncaught TypeError: Cannot read property 'Spark' of undefined handlebars.js:23
Uncaught TypeError: Cannot read property 'Spark' of undefined templating.js:23
Uncaught TypeError: Cannot read property 'Template' of undefined global-imports.js:8
Uncaught ReferenceError: Template is not defined template.xy.js:1
Uncaught ReferenceError: Template is not defined xy.js:2
Uncaught ReferenceError: Spark is not defined

Resources