Firebase Error: The property 'ac' is not defined and cannot be read

When authenticating on my web app, I utilize this straightforward code:

firebase.auth().signInWithCustomToken(token).catch(function(error) {
  // Handle Errors here.
    var errorCode = error.code;
    var errorMessage = error.message;
  // ...
});

However, after authentication, I encountered an error in my browser: 'Firebase TypeError: Cannot read property 'ac' of undefined', pointing to a potential issue in the following code snippet:

        h.set = function(a, b, c) {
            var d = this.aa(a, c)
              , e = this
              , f = Si(this, a.B);
            return f.set(d, b).then(function() {
                return f.get(d)
            }).then(function(b) {
                "local" != a.B || this.ac || (e.W[d] = b);
            })
        }
        ;

It's worth noting that I compile my es6 code using rollup and buble, and the server response indicates successful authentication:

Here is the response:

{
 "kind": "identitytoolkit#VerifyCustomTokenResponse",
 "idToken": "token",
 "refreshToken": "refreshtoken",
 "expiresIn": "3600"
}

If anyone can offer assistance with resolving this issue, it would be greatly appreciated. Thank you.

Answer №1

It seems like the issue at hand is connected to: https://github.com/firebase/firebase-js-sdk/issues/121 How can babel be prevented from changing 'this' to 'undefined'

In other words, it all boils down to this statement: "The root of your problem lies in the fact that within an ES6 module, 'this' is undefined, whereas in a "script" scenario, 'this' can take on different values depending on the environment, such as window in a browser script or exports in CommonJS code."

Answer №2

Hey @bojeil, I followed your suggestion and went as far as switching my transpiler from buble to babel in the hopes of making progress. Unfortunately, the outcome remained unchanged.

However, just 13 hours after posting this, an update from v4.2.0 to v4.3.0 was released and miraculously resolved the issue for me.

For anyone else encountering the same problem, try updating firebase - it might just do the trick!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Troubleshooting: Vue.js not triggering method after watching object

I am in need of watching a prop that is an object, so here is my script: <script> export default { watch:{ filter: { handler:(newval)=> { console.log("I have new data",newval) //this works thi ...

When touch-triggered on IOS, HTML5 Web SQL Transactions were smoothly bypassed without any errors

I'm encountering issues with database transactions on IOS devices. When the user does not interact with the phone, everything functions as expected. However, if the user taps, scrolls, or touches the screen, some transactions bypass the actual transac ...

Trouble accessing HTML file in web browser

I just finished creating a basic webpage called HelloWorld.html using HTML, JavaScript, and CSS. It runs smoothly when I open it from Eclipse IDE and view it through a browser. The functionality of the page is that it contains 5 buttons, each revealing th ...

Locally hosted website failing to transfer login details to external domain

Having trouble with an ajax call that is supposed to retrieve data from a web page, but instead returns a jQuery parse Error. Even though I can access the page directly, the ajax call doesn't seem to be working and storing the result properly. Below ...

Create a social chat platform similar to Facebook by implementing a chat box feature with the help of AJAX, jQuery

Currently, I have developed a chat box with two persistent issues. Despite my attempts to rectify them, I am unable to find a solution. Below, I will outline my code, focusing on the HTML section where the chat box, chat text area, and chat members are dis ...

Node.js HTTP requests

I am currently utilizing the code below to send a request to a host machine. Is there a way to include json data along with options? var options = { host: '172.16.2.51', port: 9090, path: '/start', ...

How to personalize your Fullcalendar event tooltips with custom profile images

I recently integrated the Fullcalendar plugin by Adam Shaw with Bootstrap 3 on my website to display events created by users. Each event has a popover script that provides additional information when clicked. One feature I would like to add is displaying ...

Encountering a problem with fetching data in a dropdown using a hidden select in MVC 4 Razor and Selectpicker

I need to show my hidden select data in dropdown-menu inner selectpicker ul with the default "--choose--" option selected. ASP.NET MVC Razor Syntax @Html.DropDownListFor(model => model.BrandName, Model.CompanyItems, "--Choose Brand--", new { @id = "B ...

Implementing a toggle function in Vue.js to add or remove a class from the body element when a

I'd like to add a toggleable class to either the body element or the root element("#app") when the button inside the header component is clicked. Header.vue : <template lang="html"> <header> <button class="navbar-toggler navbar-tog ...

Module not found in Node.js Express JS

I've read several topics on this issue here at stackoverflow, but I am still unable to get my node application running. When I try to run the command: node app.js local I receive the following error: Error: Cannot find module './config' ...

can a computed property be delayed in its calculation?

Within the code snippet below, we can see that in the compPropsIsBtnDigitizePolygonDisabled function, it initially checks if the digitizePolygonInteractions variable is initialized. If it is not initialized, an error will be triggered. During execution, w ...

Encountering the error message "Unable to access properties of null (specifically 'useState')" while trying to utilize a component from my custom library

After developing a personalized UI library and style guide to standardize components in my application, all was running smoothly until I incorporated a component utilizing the useState hook. An error consistently surfaces whenever I attempt to use a compo ...

Exploring a multitude of data within a hefty json log document using node.js

I am dealing with a JSON file named sensorlogs.json that contains data from different sensors transmitting at varying frequencies. The timestamps in the file are not in order and one sensor may have missing entries. The goal is to analyze each sensor&apos ...

Error: Attempting to access the 'body' property of an undefined object following a POST request in a MEAN application

Currently, I am attempting to send POST data from AngularJS to Express. My approach involves using curl to transmit the POST content. After sending the data and receiving a 200 response, I encounter an issue when trying to access the data through body-par ...

Vue.js does not support sorting columns

In this specific codepen example, I have created a Vue table that allows for sorting by clicking on the column name. Although I can successfully retrieve the column name in the function and log it to the console, the columns are not sorting as expected. Wh ...

Repetitive process in JavaScript

I am struggling to write certain attributes to HTML using a recursive loop and I can't seem to get the code to work properly. The JSON data consists of an array of hashes with the following attributes: serno (serial number), parent_serno (serial numb ...

Incorporating jQuery tooltips within a dynamically refreshing jQuery div

Having trouble with jQuery tooltips (using Tipsy) on a dynamically included page. The tooltips work well on regular pages, but when I include the page through PHP and set up auto-refresh using jQuery, the tooltips stop working properly. The issue seems to ...

Adding Urls in a specific format using JavaScript: A Comprehensive Guide

I am looking to insert variable data in JavaScript in the given code within the URL $(document).on('change','.sort_rang',function(){ var url = "ajax_search.php"; //console.log($("#search_form").serialize()); var data = $("#sea ...

Error in Node.js child_process: unable to access the property '_writableState' as it is undefined

I'm currently working on integrating ffmpeg's functionality into a Node.js API by utilizing the child_process library. However, I encounter an error when trying to pass data to ffmpeg's stdin pipe, specifically getting a TypeError: Cannot re ...

"The reactivity of VueJs array of objects is not triggering properly when there is a change in

My state includes an array of objects structured like this: data() { return { users: [{id: 1, name: 'bob'}, {id: 2, name: 'bill'}] } } After modifying the data as shown below: this.users[0].name = 'Mary' The watc ...