The 1.4.8 version of angular.js is throwing an error message labeled as $resource:badcfg. This error is showing up in the regular

After loading the page, Angular throws the following error:

angular.js:12520 Error: [$resource:badcfg] http://errors.angularjs.org/1.4.8/$resource/badcfg?p0=query&p1=array&p2=object&p3=GET&p4=%2Fapi%2Fprospects%2Factive
    at Error (native)
    at http://localhost:3807/Scripts/angular/angular.min.js:6:416
    at k.then.p.$resolved (http://localhost:3807/Scripts/angular/angular-resource.min.js:9:408)
    at http://localhost:3807/Scripts/angular/angular.min.js:119:129
    at r.$eval (http://localhost:3807/Scripts/angular/angular.min.js:133:313)
    at r.$digest (http://localhost:3807/Scripts/angular/angular.min.js:130:412)
    at r.$apply (http://localhost:3807/Scripts/angular/angular.min.js:134:78)
    at g (http://localhost:3807/Scripts/angular/angular.min.js:87:444)
    at T (http://localhost:3807/Scripts/angular/angular.min.js:92:50)
    at XMLHttpRequest.w.onload (http://localhost:3807/Scripts/angular/angular.min.js:93:78)

The error is likely related to the automatically triggered query method in the code below:

define(['ngResource'], function () {
    'use strict';
    prospectResource.$inject = ['$resource'];
    return prospectResource;

    function prospectResource($resource) {
        var controllerPath = '/api/prospects/';

        var actions = $resource(controllerPath, {}, {
            query: {
                method: 'GET',
                url: controllerPath + 'active',
                isArray: true,
                Cache: true
            },
            all: {
                method: 'GET',
                url: controllerPath + 'all',
                isArray: true,
            },
            convert: {
                method: 'POST',
                url: controllerPath + 'convert/:prospectId'
            }
        });

        return actions;
    }
});

Interestingly, the error only appears in normal browsing mode in Chrome, not in Incognito. Attempts to clear cache, cookies, and even disabling plugins like Ad-blocker have been unsuccessful in resolving the issue. The question now is, what could be causing this discrepancy? Why does the error persist in normal mode but not in Incognito where everything works smoothly?

The version of Angular in use is 1.4.8

Answer №1

The issue turned out to be related to cookies. To resolve it in Chrome, simply navigate to

Settings -> Show advanced settings… -> "Clear browsing data…" -> the beginning of time -> select all options -> Clear browsing data
. After completing these steps, everything began functioning properly.

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

Error: The function screams cannot be accessed in this.state in React JS when using Firebase

This is the code I am working on and I need help to solve a problem: import React, { Component } from 'react' import Grid from '@material-ui/core/Grid'; import axios from 'axios'; class home extends Component { state = { ...

The forEach method in JavaScript seems to work asynchronously

After reviewing other discussions on this platform, it seems that the general agreement is that forEach should be synchronous and block. However, in my code, something appears to be off as it doesn't behave that way: var noDupes = false; // se ...

Guide to utilizing an if statement to return a string as the title in a Tooltip pro

When attempting to dynamically set the title of a tooltip based on a function and using an if statement, I encountered an error. const getStatusMessage = (answer: AnswerStatus) => { if (answer == AnswerStatus.ANSWER_SUBMITTED || answer == AnswerStatus ...

Is it possible to pass multiple functions to the parent component in ReactJs if using OnChange() as a prop?

Just getting started with React and trying to pass data from a child component to a parent component. <div className="filter-module"> <i className="fas fa-sign-in-alt icon"></i> < ...

Error Detected: the C# script is not compatible with Javascript and is causing

I am facing an issue where I can successfully send information from the database, but I am unable to load the table on the page. When I check the data received with an alert, it appears to be in JSON format, but it still displays the wrong image on the web ...

"Encountering a restricted URI error when attempting to load a text file using AJAX

After reviewing the recommended link, I found myself struggling to grasp the suggestion to "Use Greasemonkey to modify Pages and start writing some javascript to modify a web page." Currently, I am encountering an error when loading a text file using $.aj ...

Modifying the color of a header through clicking on a specific anchor link

My goal is to create a fixed side nav bar on my webpage with an unordered list that links down the page using anchors. In addition, I want to dynamically change the color of an h2 element based on which item in the fixed nav bar is clicked on. For instan ...

Tips on obtaining the element selector when a div is being dynamically loaded during an AJAX call

When running two ajax calls, I encounter an issue where the second call loads some HTML onto the page that is needed for processing a specific div in the first call. However, since the div is not present until after the second call is completed, I receiv ...

Incapable of stopping a form submission when a certain criteria is satisfied

I am currently working on a form validation system using jQuery $.ajax. The aim is to only allow submission of the form if a specific condition, data == 1, is met. var preventSubmit = function() { return false; var form = $(this), name = form.find ...

"Incorporating Adobe Edge Animate alongside AngularJS and AngularUI Router for dynamic web design

Currently, I'm in the process of integrating multiple animations created using Adobe Edge Animate into a single AngularJS application for a project. These animations will serve as the visual elements for a game, with player input controlling the compo ...

The AJAX POST request is not receiving the JSON data as expected

After creating an HTML form with the following structure: <form id="loginForm" name="loginForm"> <div class="form-group"> <input type="username" class="form-control" id="username" name="username" placeholder="Your username..." > ...

Update my function to be asynchronous by changing async: false to async: true using JQuery and Ajax

I've created a function in a JavaScript class that accesses a PHP file to retrieve information from a database. Although this function works well, I attempted to set the property async: true, and it caused the function to stop working. (I received th ...

Display the username on a Meteor React component

I'm facing an issue with one of my React components, which serves as the main layout for my application. It includes a navigation bar that displays the username of the currently logged-in user. The problem arises when Meteor.user() returns undefined d ...

Ways to view the outcome of json_encode function?

In PHP, I have an array that looks like this: $user_data = Array ( [session_id] => 30a6cf574ebbdb11154ff134f6ccf4ea [ip_address] => 127.0.0.1 [user_agent] => Mozilla/5.0 (Windows NT 5.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 [las ...

Event triggered only upon initial click

I am experiencing an issue with my category list. When I click on a category to trigger an AJAX request for the first time, the request does not go through. However, when I click on the same category a second time, it works perfectly. Below is the code sni ...

Utilizing Express.js: Passing the req Object to Middleware without the Need for a New Multer Route

Hello to the Express.js and StackOverflow communities! I hope this question is not a duplicate, as I searched and found nothing similar. Currently, I am working on a project using Multer with Express to enable users to upload images, which will be saved a ...

Implementing dotenv in a Node JS package

I'm in the process of developing a Node application that retrieves search results through a Google Custom Search Engine (CSE). To streamline the process, I plan to extract the component responsible for sending requests to Google and receiving the res ...

The onclick event for a Bootstrap .btn-group checkbox functions correctly in JSFiddle, but encounters issues when tested

The toggle button group in the form below utilizes Bootstrap and checkboxes. I am looking to track click events on the checkbox inputs. <html> <head> <title>Example: Bootstrap toggle button group</title> <meta charset="UTF-8 ...

Using Jquery toggleClass on a specific icon without impacting the other icons that share the same class

I am currently working on a project where I have multiple divs that each contain an SVG as a background image, specifically for audio player buttons. My goal is to toggle the class of the clicked element without affecting the others. However, I am struggli ...

Utilizing the LinkedIn API: Posting a network update using a variable value

Currently, I have a string variable and I am looking to post the value stored in this variable as a network update on LinkedIn. Could someone please provide guidance on how I can modify the code below to make this functionality possible? updateURL = "/pe ...