Questions tagged [typeerror]
A TypeError is a specific type of error raised when an operation or function is applied to an object of inappropriate type. You might encounter it in Python or JavaScript.
6,711
questions
0
votes
0
answers
31
views
TypeError "cannot set properties of undefined" when Shuffling Array from Module
when I try to shuffle an array I get a TypeError: "cannot set properties of undefined (setting '10')" where 10 is the value of randomNmbrArr[0]. I have 2 other functions that I copied this ...
-1
votes
0
answers
24
views
TypeError: __init__() got multiple values for argument 'shape'
I am trying to create a sparse matrix by running the following code:
sparse.coo_matrix([1,-4,7,-1,3], ([0,0],[2,0],[4,0],[6,0],[8,0]), shape = [10,10])
I am receiving the following error:
TypeError: ...
1
vote
1
answer
24
views
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'json')
Problem is that when i press selector to select continents its gives me this error /Search buy the way works fine only problem is with selector it maybe due to me using react-router-domV6 and Axios ...
0
votes
0
answers
8
views
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')?
I'm building an ecommerce project with vue3 and a spring boot backend, I'm trying to display products under a category but every time I attempt this I get the error; Uncaught (in promise) Type Error:...
-1
votes
1
answer
20
views
Why the type errors are blocking the UI
I started a new create react app with typescript and for any type error, the ui is covered by this black screen showing errors, i want to see type errors only in terminal
Compiled with problems:X
...
-1
votes
2
answers
27
views
TypeError in python CoLab
I used the Collab website to program in Python and I got this error and I don't know how to correct it. I was trying to apply a code to some dataset, but I encountered this error. Here is a picture of ...
0
votes
1
answer
14
views
Type Error generated when updating a Dash Plotly graph
I am running a code that produces a Dash Plotly scatter graph that can be updated using a radio button. An empty graph is generated and I am getting a callback error updating graph.figure each time I ...
0
votes
0
answers
34
views
TypeError when posting objects
When I post an empty object to my server using my Vue website it works, but when I do it with an object that is full, it gives me this TypeError.
TypeError: 'caller', 'callee', and 'arguments' ...
1
vote
1
answer
66
views
Google Apps Script FOR Loop failing to automatically iterate with nested IF statements
Overview
I'm constructing a script to assign individuals to groups based on first-come-first-served ranked preference input data. The script constructs a response order from the data array using two ...
-3
votes
1
answer
22
views
Uncaught (in promise) TypeError: layerView.createQuery is not a function
Layer.fromArcGISServerUrl("").then(function (layer) {
map.add(layer);
view.popup.autoOpenEnabled = false; // <- disable view popup auto open
...
-2
votes
1
answer
22
views
python: Pick the x amount of biggest numbers from list, but I get TypeError - NoneType
I'am new to python. I tried to write this code but I always get a TypeError.
This is the task:
finds the length_subset biggest values in a
Parameters
a:
array to find the biggest values in
...
1
vote
1
answer
42
views
Spark/Scala - Join resultset giving type mismatch error while performing withColumn operation; found : org.apache.spark.sql.Column required: Boolean
I have two dataframes that I am trying to join and based on the joined set trying to assign a flag column.
demandDF1
+--------+-----------+---------+
|rgn_nm |file_crt_dt|file_vrsn|
+--------+--------...
0
votes
0
answers
28
views
TypeError: only integer scalar arrays can be converted to a scalar index in Streamlit
So, i was trying to upload an image in streamlit.
After uploading the image in streamlit, a bounding box is created. So when I do the same, it gives me TypeError. I tried to convert the datatype but ...
1
vote
1
answer
29
views
Remove original data from regression_forest without changing the type to "list"
I would like to estimate a regression_forest with the grf package and remove the original data that is stored in the regression_forest output for data protection reasons.
The problem is that when I ...
1
vote
1
answer
34
views
Uncaught TypeError: Cannot read properties of undefined (reading 'params') while using axios and react-router-dom
It's the HomePage component of ReactJS
import React from 'react';
import axios from 'axios';
import { useState, useEffect } from 'react';
import { useNavigate,useParams } from 'react-router-...
0
votes
0
answers
40
views
When i run npm run watch, i get TypeError: The 'compilation' argument must be an instance of Compilation, does anyone know why?
I am currently working on a website using symfony and i use webpack to compile the CSS and JS. When i try npm run watch, i get the following :
TypeError: The 'compilation' argument must be an instance ...
1
vote
1
answer
31
views
Type Error when running function with Class
I have a class named Individual, and I have a function based on it. When I run I get
---> 13 population: list[Individual], elite_size=0.1, new_pop=0.2
TypeError: 'type' object is not ...
0
votes
1
answer
38
views
getting error Failed to execute 'fetch' on 'Window': Invalid name
I am trying to publish API in wso2 API Manager. But I am using basic security with my authorization key. I am getting a type error: Failed to execute 'fetch' on 'Window': Invalid name. I tried to ...
0
votes
0
answers
31
views
TypeError with Vitest: Cannot read properties of null (reading 'useRef')
I am trying to set up testing for my React app using Vitest, but I am experiencing an error which must be due to some missing dependency or error in my test suite. I'm unsure what exactly is the cause....
0
votes
1
answer
24
views
I can't get rid of this problem while working with gulp file TypeError: Cannot read properties of undefined (reading 'pipe')
I am trying to setup my gulpfile for future projects and on the firt stage bumped into a problem that accompanies me no matter what do I do with my code:
Here it is :
"TypeError: Cannot read ...
0
votes
1
answer
27
views
How to correctly add the last index value from another df to an empty df? Pandas related
Say I have the following empty df named df_pnl, after being called it produces the following output:
Empty DataFrame
Columns: [PnL, Type of Trade, ROI, Cumulative ROI, Cumulative Investment]
Index: []
...
0
votes
1
answer
33
views
Add additional functionality to end method on Node/Express Response object?
My team and I are trying to mutate the response.end method in our Express middleware in order to have extra functionality be called just before the server responds back to the client.
Here is our ...
0
votes
1
answer
25
views
Uncaught TypeError: Cannot read properties of undefined (reading 'replace'). I am facing this error in my site
I am using this code on the WordPress website and errors continuously coming to my site.
<script>
function setNiceResult(valor, id){
var div = $("#"+id);
...
0
votes
0
answers
7
views
Type Error's While Implementing Google Map React, white screen with lot's of error in console
While implementing Google Maps react in my project I got a lot of type errors.
Whenever I Type some properties in the component I got an error otherwise app runs without any errors.
'''
<...
0
votes
2
answers
69
views
Azure generate_blob_sas TypeError
I am using the Azure Blob Storage python SDK and trying to generate a sas token for my blob, however I keep getting a TypeError.
This is how I'm calling the built-in function (generate_blob_sas).
...
0
votes
0
answers
20
views
Uncaught TypeError: portfolioItems.forEach is not a function
Uncaught TypeError: portfolioItems.forEach is not a function:
const target = event.target.getAttribute("data-target");
portfolioItems.forEach((item) =>{
console.log(item....
0
votes
1
answer
22
views
Flutter + syncfusion charts: Is it possible to have a dataSource that is not a List? (type 'BanditData' is not a subtype of type 'List<BanditData>')
I am trying to display a bar chart in my app with the syncfusion library. It contains 6 bars where the height is defined by a score and the name is a player name. I have the following methods: ...
0
votes
2
answers
27
views
TypeError: Cannot read properties of undefined (reading 'data') is this due to the type I've given my useState?
I'm receiving this error in my terminal although my code and tests are running fine:
src/components/Weather.tsx:31
setWeather(response.data.result.weather);
^
TypeError: ...
0
votes
0
answers
16
views
TypeError: cy.findAllByText is not a function e2e-cypress-1 at Context.<anonymous> when run through docker-compose
1. I have added testing-library add-commands in support.js
2. I have created 2 jsconfig.js files to include cypress types
3. I have added comments in spec file to include cypress.
The tests works ...
0
votes
1
answer
22
views
SageMaker Monitoring Tutorial boto3 Object Function Type Error
I am following the steps in the SageMaker Monitoring Tutorial here:
https://sagemaker-examples.readthedocs.io/en/latest/sagemaker_model_monitor/introduction/SageMaker-ModelMonitoring.html
And for the ...
0
votes
1
answer
20
views
Esri-leaflet error "Uncaught TypeError: Cannot read properties of undefined"
I have an old esri-leaflet map that queries and displays a feature from a published feature service. I'm migrating the dashboard that uses this map to a new server that requires https. I keep getting ...
0
votes
1
answer
13
views
How do you a change guild icon from a list of randomly selected local image's?
I have been trying to make a Slash command to change the Guild's icon. The icon it changes it to is picked from a list of icons at random but I'm getting this error and have no idea what it means:
...
0
votes
0
answers
67
views
TypeError after processing last row using apply with lambda using function retuning multiple values
Here I am trying to find three different values of a sentence from that of every word it has and save them in the same dataframe in different columns for sentiment measurement. I am providing a list ...
-1
votes
2
answers
47
views
TypeError while converting int to string in python [closed]
I'm using str() to convert int to string but I am getting TypeError.
This is the code which I have written:
print("Welcome to the Love Calculator!")
name1 = input("What is your name?...
-1
votes
1
answer
34
views
I am creating my own class. There's a type error that _Screen.__init__() takes 1 positional argument but 4 were given. What am I doing wrong?
# Set up the screen
import turtle
class Screen(turtle.Screen()):
# Create and define an object
def __init__(self, title, bgcolor, height, width, tracer = 0):
turtle.Screen().__init__(self)...
0
votes
0
answers
45
views
TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator)
What I'm doing wrong. Below is my code.
// Imports
import { getAuth, signInWithPopup, GoogleAuthProvider } from "firebase/auth";
import { app } from "../../firebase.config";
import ...
0
votes
2
answers
32
views
typeError while adding items to list through a function
so currently im working on a function where you add countries you visit, times visited and cities visited to a list however whenever i add the arguments to the list through the function i get a type ...
0
votes
0
answers
14
views
I am useing YOLO v3 wiht python 3.7 TypeError: Can't parse 'bboxes'. Sequence item with index 0 has a wrong type
I am trying to use a pretrained YOLOv3 object reconition model in pycharm but am getting this error:
Traceback (most recent call last):
File "A:/YOLO object detection/main.py", line 67, in
...
-1
votes
1
answer
23
views
simple python menu - missing Self [duplicate]
TypeError: Menu() missing 1 required positional argument: 'self'
I have put self.Menu() in init class and still has error, i have tried to also put self.Menu = Menu() and same error issue. i need to ...
-1
votes
2
answers
41
views
TypeError (can't concatenate NoneType to str)
def emoji_convert(massage):
split_words = massage.split(" ")
emoji = {
":)": " 😁",
":(": " 😞",
":": " ...
0
votes
1
answer
16
views
Python: Iterating though dataframe columns as values in a function that prints charts
I'm trying to iterate through numeric fields in a data frame and create two separate bar charts one for Test1 and another for Test2 scores grouped by Name. I have a for loop that I get a type error on....
0
votes
0
answers
19
views
Value Error When Using GridSearch Function with Model Pipeline [Python]
This is the code I used to tune and fit an SVC model using a pipeline but it keeps raising a Value error:
ValueError: Target is multiclass but average='binary'. Please choose another average setting, ...
2
votes
1
answer
42
views
Can not properly set value of object field
I need to set values of fields of person object which exists in employee object. But I can't do it properly without type errors
Here is my code:
interface IPerson {
name: string;
age: number;
}
...
-1
votes
1
answer
28
views
Odd "Uncaught (in promise) TypeError: can't convert 50057 to BigInt" error with WebAssembly
I am trying to interface with WebAssembly and am getting a weird error. Firefox DevTools shows it as follows:
Uncaught (in promise) TypeError: can't convert 50057 to BigInt
The code that runs right ...
-1
votes
1
answer
14
views
TypeError: unsupported operand type(s) for &: 'float' and 'DatetimeArray'
I have two user defined variables that are created as strings in the format "%m%d%y" I need to convert these values to a datetime to filter out records in a pandas dataframe where the ...
0
votes
1
answer
30
views
Pandas dataframe - 'bool' object is not subscriptable
I am trying to retrieve records in a dataframe that do not have matching IDs in a separate list. Essentially, I want to drop any records from the dataframe where UniqueId matches any Ids in the list ...
0
votes
1
answer
19
views
Handling a TypeError: unhashable type: 'list' when switching from fetching a single item to fetching a list
I am trying to fetch data from a JSON endpoint. It doesn't work anymore now that I have switched from fetching just one data value coin['id'] to fetching multiple ones. I have this code:
class Checker:...
0
votes
1
answer
20
views
TypeError: readFImage() missing 1 required positional argument: 'imgc'
I have defined a function as follows
def readFImage(imgc):
reader = easyocr.Reader(['en', 'hi'])
result = reader.readtext(imgc ,paragraph=True)
top_left = tuple(result[0][0][0])
...
1
vote
2
answers
62
views
How to populate a 2D array with random elements?
For a Memory game, I'm trying to randomly populate a 2D array with letters.
The grid is size × size and each letter occurs twice.
This is my code so far. I don't understand why it is giving an error
...
0
votes
0
answers
9
views
throw er; // Unhandled 'error' event TypeError: Cannot read property 'name' of null
here is my code
var requestdID = req.params.name;
Post.findOne({ name: requestdID }, function(err, post) {
if (err) {
res.send(err)
} else {
res....