Local Storage error with JBoss - javascript

I have a Web App on Firebase, the application is running on the server fine, the alert is also working fine it shows the correct user id,
but with the BrowserSim(JBoss Plugin) Emulator on Eclipse, I got these errors:
!JavaScript WARN: FIREBASE WARNING: Exception was thrown by user callback.
!JavaScript ERROR: TypeError: 'null' is not an object (evaluating 'localStorage.setItem') on line 17
Here is the Javascript code:
rootRef.authWithPassword(userObject, function(error, user) {
if(error) {
alert(error + " " + error.code);
location.refresh();
}
if(user) {
alert(user.uid);
localStorage.setItem("uid", user.uid);
location.href = "overview.html";
}
});
Why does the localStorage isn´t working on the emulator ?

The problem was the emulator cache from Eclipse for the internal storage was full and has a bug. It works a few times fine and after this it has a bug and returns null.

Related

Firebase Auth sendEmailVerification() I'm getting an Error, but only with Safari browser

When a user signs up, I am requiring them to verify their email address.
It works fine in Firefox and Chrome, but not in Safari, where I get the following message:
Error: A network error (such as timeout, interrupted connection or unreachable host) has occurred.
And no confirmation email is sent.
I’m sourcing this version:
firebasejs/6.4.0/firebase-auth.js
I've searched for similar problems. There were lots of Firebase Authentication errors, but I didn't find this one.
Using the Safari JavaScript debugger, filtering for all exceptions I receive the errors below.
And interestingly, after stepping through with the debugger on, setting Breakpoints at "All Exceptions" an email is sent. But not when running in real-time.
Hopefully that is a clue.
I send the email verification with this code.
if (current_user && !current_user.emailVerified) {
current_user.sendEmailVerification().then(function() {
const user_message = '<message to user>';
window.location = '/message?message=' + user_message;
}).catch((error) => {
console.log(error);
} );
}
The errors:
line 515 rpchandler.js
try {
response = JSON.parse(this.getResponseText()) || null;
It looks like the response is null.
line 183 promise.js Exception with thrown value: zi
try {
// Promise was rejected. Step up one call frame to see why.
if (reason instanceof Error) {
throw reason;
This happens a few times.
line 2190 authuser.js
// Cache the invalidation error.
self.userInvalidatedError_ = /** #type {!fireauth.AuthError} */ (error);
line 740 firebase-app.js
Exception with thrown value: TypeError: Argument to String.prototype.startsWith cannot be a RegExp
Any ideas?
I ended up rolling my own email verification workflow.
I'd be interested in reverting back to the Firebase Auth JavaScript email verification workflow, if there is a solution. But for now, I just have to move forward.

Sending 500 ("Server Error") response when visiting any url in Sails App

I am using Sails and Mysql to handle the database of my app. I recently clicked on a chrome autofill URL that took me to a 404'd page, since that url localhost:1337/companies was not active in this project.
Ever since I did that, my app returns
error: Sending 500 ("Server Error") response:
Error (E_UNKNOWN) :: Encountered an unexpected error
: ER_BAD_FIELD_ERROR: Unknown column 'NaN' in 'where clause'
and
Details: Error: ER_BAD_FIELD_ERROR: Unknown column 'NaN' in 'where clause'
any time I go to a url in my app. I tried cloning my app and relinking the database to no avail. I see this is a common issue people run into with sails, but none of the mentioned solutions were able to fix it for me.
Everything was working before I clicked that URL which makes me believe it may be a route issue, but the app still works, it will just fill up my terminal with the above errors.
Any help is greatly appreciated!
Edit: this is the custom API call I was working on in my controller.js when I started seeing the error:
winner: function (req, res) {
User.findOne({id: req.param('id')}).exec(function(err, user) {
if (err) {
return res.negotiate(err);
}
else {
var u = user;
u.totalwins++;
u.save();
sails.io.sockets.emit("chat", {verb:"score", data:{id: req.param('id'), name: user.name}});
}
});
}
Also receiving this error in my chrome-browser console:
:1337/user/quizzes Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Im using ZF2 in my ongoing project it gives network error on singup

I'm new in this framework, this project is developed with redis and mysql but the console is not giving database connectivity error. It is pointing towards the following code having network error in console.log() which is in utils.js
function log(TAG, str)
{
if (debug) {
if ($.inArray(TAG, enabled) != -1)
console.log(TAG + ":" + str);
}
}
}

'WebSocket.URL' is deprecated. Please use 'WebSocket.url' instead

WebSocket connection to 'ws://localhost:35729/livereload' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED chromereload.js:9
'WebSocket.URL' is deprecated. Please use 'WebSocket.url' instead. chromereload.js:12
I'm getting this error message in my chrome extension since chrome updated to version 38. I'm not quite sure whats going on here, but now opening most things causes the extension to crash. I used yeoman to scaffold my project at the beginning, and everything was working fine. I tried removing livereload from the manifest, but that seems to break everything. Any help would be appreciated.
Here is the code:
'use strict';
// Reload client for Chrome Apps & Extensions.
// The reload client has a compatibility with livereload.
// WARNING: only supports reload command.
var LIVERELOAD_HOST = 'localhost:';
var LIVERELOAD_PORT = 35729;
var connection = new WebSocket('ws://' + LIVERELOAD_HOST + LIVERELOAD_PORT + '/livereload');
connection.onerror = function (error) {
console.log('reload connection got error' + JSON.stringify(error));
};
connection.onmessage = function (e) {
if (e.data) {
var data = JSON.parse(e.data);
if (data && data.command === 'reload') {
chrome.runtime.reload();
}
}
};
In Chrome this message is emitted when using something like JSON.stringify() or similar on a WebSocket object. These kind of routines will access the WebSocket.URL property, which is deprecated, and emit this warning. Even if your code doesn't explicitly call WebSocket.URL. You can delete this property to mute the warning from Chrome.
var ws = new WebSocket('wss://example.com/');
delete ws.URL;
console.log(JSON.stringify(ws));

uncaught reference error: FileTransfer not defined at cordova.js(3.0.0)

I am bulding a simple cross platform app using cordova 3.0.0. The installation went fine. But I cannot seem to get the file transfer to work. I keep getting this error.
processMessage failed: Error: ReferenceError: FileTransfer is not defined at file:///android_asset/www/cordova.js:1035
I have installed all the plugins properly and also calling device ready as such:
function onLoad(){
document.addEventListener("deviceready",onDeviceReady,false);
}
My code is as follows:
function uploadFileForCapture(mediaFile) {
var ftforcapture = new FileTransfer(),
path = mediaFile.fullPath,
name = mediaFile.name;
alert(path + name);
ftforcapture.upload(path,
"http:/some.server.com/upload.php",
function(result) {
alert('Upload success: ' + result.responseCode);
alert(result.bytesSent + ' bytes sent');
},
function(error) {
alert('Error uploading file ' + path + ': ' + error.code);
},
{ fileName: name });
}
Can some one please help!
Thanks a lot in advance!
I ran into this error as well. For me the file transfer plugin was never successfully installed. It was not in the android platform folder with the other plugins that I was using. I was installing with the cli client. I created a fresh project and noticed that when I ran this cordova plugin add command that I received this error.
[TypeError: Arguments to path.join must be strings]
I tried a clean install on a virtual machine expecting it to be something in my setup but it still didn't work. Before I could file a bug report on it, Cordova 3.1.0 was released. I created my project over and this time the file transfer plugin was successfully installed.

Categories

Resources