Uncaught ReferenceError: Meteor is not defined - javascript

I'm following a tutorial to create a Meteor app and I've been having the same error regarding different things in the developer console.
> Meteor.users.find().count();
VM2034:1 Uncaught ReferenceError: Meteor is not defined(…)(anonymous function) # VM2034:1
> Session.set('pageTitle', 'A different title');
VM2035:1 Uncaught ReferenceError: Session is not defined(…)
From researching the problem, the 2 solutions that come up are: (1) doing
meteor add session
which I have done; (2) updating the Meteor version but I am running Meteor 1.3.3. Neither works.
EDIT: After doing meteor update, the Meteor error disappeared once but came back the second time I tried a command based on Meteor.
Any idea on how to solve this?

If you are trying to set the session outside the client folder you will get this error. Which is why you must do:
if(Meteor.isClient) {
Session.set('pageTitle', 'A different title');
}
Then you can check it worked simple write in console:
Session.get('pageTitle')
Will output: "A different title"
Good luck!

Related

Failed to Load Resource In Production but Not Locally

I am working on a Django project and I have it deployed on pythonanywhere.com. In my project, I am using Django Jsignature which works fine on my local machine. In production, however, when I load the particular template, I get this error in my console - 'myurl' portion is not the real url.
https://myurl.com/static/js/jSignature.min.js net::ERR_ABORTED 404 (Not Found)```
So I don't get this locally, but do in Production. Can anyone suggest for me where to start on this? I'm not even really sure where to begin, it's my first time deploying anything.
EDIT
you can see the details of django jsignature here: https://pypi.org/project/django-jsignature/
the {{form.media}} should load this script.
UPDATE 2
This is no longer working locally either. Here are the error in my console.
Uncaught SyntaxError: Invalid or unexpected token jSignature.min.js:70
Uncaught TypeError:
$(...).jSignature is not a function

" 'app' is undefined " when developing an Office add-in

So I am learning how to develop an MS Project add-in.
I was successful in deploying the tutorial (yayy!): https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/project-quickstart
Then I replaced the html and the js code with the example code from here: https://dev.office.com/reference/add-ins/shared/projectdocument.gettaskbyindexasync
And it stopped working!
I started a new project from scratch. Again, as in the tutorial, "Office Add-in project using Jquery framework", "Javascript" as selected options.
And it still didn't work.
Error message from F12 dev tools:
jQuery.Deferred exception: 'app' is undefined ReferenceError: 'app' is undefined
at Anonymous function (eval code:14:13)
at mightThrow (https://localhost:3000/node_modules/jquery/dist/jquery.js:3534:10)
at Anonymous function (https://localhost:3000/node_modules/jquery/dist/jquery.js:3602:12) undefined
SCRIPT5009: 'app' is undefined
jquery.js (3827,3)
The error is spawned from the following row from the JS code:
app.initialize();
There is no "app.initialize();" in the tutorial. If I decide to delete this row, the error goes away (naturally), but then interacting with the functionality spawns another error message:
Unable to get property 'push' of undefined or null reference
Then I tried to define some 'app' Object.
I initialized it with
var app = Object.context;
The error then is:
Unable to get property 'initialize' of undefined or null reference
I am still trying to figure out, where this 'app' Object comes from. Or at least, how can I define it properly. Any ideas?

NextJS + Apollo + i18n - unexpected error

The client I am working with at the moment has requested I build a SSR React app which includes i18n. To solve this problem I tried to use NextJS and i18Next.
I managed to get react and apollo linked up without issue but when I tried to connect next + i18n I keep getting a very unhelpful 'an unexpected error' occured, error.
Inspecting the console I also see the following:
Cannot read property 'prototype' of undefined
TypeError: Cannot read property 'prototype' of undefined
at Object.inherits (http://localhost:3000/_next/1515592576452/page/index.js:36080:46)
at Object.<anonymous> (http://localhost:3000/_next/1515592576452/page/index.js:30216:6)
at Object.<anonymous> (http://localhost:3000/_next/1515592576452/page/index.js:30440:30)
at __webpack_require__ (http://localhost:3000/_next/1515592576452/manifest.js:714:31)
at fn (http://localhost:3000/_next/1515592576452/manifest.js:117:20)
at Object.<anonymous> (http://localhost:3000/_next/1515592576452/page/index.js:28246:12)
at Object.module.exports.exports.byteLength (http://localhost:3000/_next/1515592576452/page/index.js:28507:30)
at __webpack_require__ (http://localhost:3000/_next/1515592576452/manifest.js:714:31)
at fn (http://localhost:3000/_next/1515592576452/manifest.js:117:20)
at Object.<anonymous> (http://localhost:3000/_next/1515592576452/page/index.js:24501:18)
Also this warning but i'm not sure it's related
warning.js?e7f4ca8:33 Warning: Expected server HTML to contain a matching <div> in <div>.
I've also noticed that in ./libs/withData.js there is the following line:
enter code herestatic displayName = WithData(${getComponentDisplayName(
ComposedComponent
)})
My editor flags that as an invalid token but this code came from the nextjs example and there is no issue on that repo which suggests it's a typo.
I've included all the code that pertains to this issue in the following codepen project.
https://codepen.io/foxleigh81/project/editor/DnYJWB
OK I've sort of worked it out.
In a nutshell. I was thinking about this all wrong. I was thinking I was adding next to my react app, whereas the reality is more like I'm putting my react app inside next. I took it apart and rebuilt it from scratch, assembling the examples on the nextjs repo and it all worked.

Page not launching with AngularSeed on Firebase URL

I followed in detail the five minute tutorial at: https://www.youtube.com/watch?v=hj0LyZ13D3Q
I executed the following steps:
I set up an account at Firebase.com
I set up a new app within my Firebase account
I opened my terminal and:
sudo npm install -g firebase-tools
firebase login (followed by email and password for firebase.com)
firebase bootstrap
selected the new app as listed from Firebase
chose the angular template
cd to the newly created directory
firebase login
On the video, the new site is up and running at https://newapp.firebaseapp.com
In my case I get nothing but a blank screen and my JS console provides nothing but a series of errors:
GET https://myapp.firebaseapp.com/bower_components/html5-boilerplate/css/normalize.css myapp.firebaseapp.com/:9
GET https://myapp.firebaseapp.com/bower_components/html5-boilerplate/css/main.css myapp.firebaseapp.com/:10
GET https://myapp.firebaseapp.com/bower_components/angular/angular.js myapp.firebaseapp.com/:33
GET https://myapp.firebaseapp.com/bower_components/html5-boilerplate/js/vendor/modernizr-2.6.2.min.js myapp.firebaseapp.com/:12
GET https://myapp.firebaseapp.com/bower_components/angular-route/angular-route.js myapp.firebaseapp.com/:34
GET https://myapp.firebaseapp.com/bower_components/firebase/firebase.js myapp.firebaseapp.com/:35
GET https://myapp.firebaseapp.com/bower_components/firebase-simple-login/firebase-simple-login.js myapp.firebaseapp.com/:36
GET https://myapp.firebaseapp.com/bower_components/angularfire/dist/angularfire.js myapp.firebaseapp.com/:37
Uncaught ReferenceError: angular is not defined app.js:4
Uncaught ReferenceError: angular is not defined config.js:4
Uncaught ReferenceError: angular is not defined controllers.js:5
Uncaught ReferenceError: angular is not defined decorators.js:9
Uncaught ReferenceError: angular is not defined directives.js:6
Uncaught ReferenceError: angular is not defined filters.js:5
Uncaught ReferenceError: angular is not defined routes.js:3
Uncaught ReferenceError: angular is not defined services.js:6
Uncaught ReferenceError: angular is not defined firebase.utils.js:3
Uncaught ReferenceError: angular is not defined simpleLogin.js:2
Uncaught ReferenceError: angular is not defined
I'm using Node v0.10.32, Firebase Command Line Tools Version 1.1.2
For whatever reason, the tutorial omited the bower angular bower_components. https://github.com/firebase/generator-angularfire
I copied and pasted them from another project and put the corresponding scripts from the other project in the head of my index.html and it works.

JavaScript runtime error: 'fidoCallback' is undefined

I have built an asp.net application. Every time I am running it, I am getting an error saying:
Unhandled exception at line 1, column 1 in script block
0x800a1391 - JavaScript runtime error: 'fidoCallback' is undefined
I have tried adding
function fidoCallback(status) { }
but it is not helping. Any help would be appreciated.
Got the actual reason behind the error. It is because of the Nok Nok Labs installed. Uninstall that from your extensions and then you can see that the error does not repeat. No need to add fidocallback after this.
Actually, the name of the Nok Nok Labs package is "Multifactor Authentication Client". Just uninstall this package from "control panel/programs and features".

Categories