Uncaught TypeError: Cannot read property 'register' of undefined - wordpress

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.

Related

Error: getaddrinfo ENOTFOUND undefined on a specific page

We use next.js with knex.js as query builder, in all pages everything is OK except in one page that we have ISR aka getStaticPaths and in that method we get the following error whenever we try to execute a query, but in other pages that do not have getStaticPaths everything works fine:
Server Error
Error: getaddrinfo ENOTFOUND undefined
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
GetAddrInfoReqWrap.onlookup [as oncomplete]
node:dns (71:26)
no more info is provided anywhere else. as it is shown in the error message, the database host is undefined but why it read correctly everywhere except in getStaticPaths??
Turns out we had this experimental feature tuned on in next.config.js, when it is turned on .env variables are all undefined and not loaded correctly inside getStaticPaths but once the getStaticProps is called everything is OK, I do not know the reason for this, but turning workerThreads off solved the problem:
experimental: {
workerThreads: false //fixed the problem
},

TypeError: Cannot read property 'then' of undefined. problems with plugins cordova?

This error is thrown while createDB is called in SQLite DB plugin in Ionic4:
> common.js:297 Native: tried accessing the SQLite plugin but Cordova is
> not available. Make sure to include cordova.js or run in a
> device/simulator cordovaWarn # common.js:297 home.page.ts:21
> TypeError: Cannot read property 'then' of undefined at
> HomePage.createDB (home.page.ts:28)
this is my home.page.ts:

WP Facebbok Login - errors while loading page

I really do not know the advice. No facebook application settings work.
Thank you
XMM-b79-1BK.js:44 Uncaught Error: Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.
at a (XMM-b79-1BK.js:44)
at a (XMM-b79-1BK.js:121)
at x (XMM-b79-1BK.js:193)
at Object.b.post [as log] (XMM-b79-1BK.js:193)
at a.logVital (XMM-b79-1BK.js:219)
at XMM-b79-1BK.js:293
at Array.forEach (<anonymous>)
at IntersectionObserver.f.threshold (XMM-b79-1BK.js:293)
It is a known bug, you can subscribe here: https://developers.facebook.com/support/bugs/1337180213092053/

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

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 () {

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

Resources