Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
-4 votes
1 answer
76 views

Cypress on headless mode not able to resolve promises through await calls

I am developing an API testing backend using Cypress with cy.request. I am aware that cy.request natively uses built-in promises (Cypress.Chainable), so there is no need to handle it with JavaScript ...
rangana dilhara's user avatar
0 votes
1 answer
47 views

fs.writeFile adds extra brackets to json of key=>values object in node.js

I'm trying to update one JSON file in a for loop called asynchronously. Each time I update the whole file, with 1 object. This is my very complex code after half a day of research. (I know it's too ...
Magor Menessy's user avatar
0 votes
3 answers
69 views

getting NaN value some times and some times not

I get NaN value when I try to show the value of (item.total_amount,item.price,item.addtional_price) in ejs page but when I debug the variables some time I get the value and some time not!! this is the ...
Ali Alariqi's user avatar
-1 votes
1 answer
53 views

Format JSON file from text [duplicate]

I would change format file My current files format Email:Password Email:Password Email:Password I would like to change it to JSON format but can't do it manually because there are around 500+ ...
Diablo's user avatar
  • 1
0 votes
0 answers
21 views

Unterminated string in JSON at JSON.parse with [email protected] after moving to a new database

I recently encountered an issue after moving my application to a new MariaDB database environment. I'm using the mariadb Node.js client version 3.2.3. The query works without issues in the production ...
Ahmed Hafez's user avatar
0 votes
1 answer
71 views

SyntaxError: No number after minus sign in JSON at position 1 (line 1 column 2) [duplicate]

I get this error on the backend side: Create error: SyntaxError: No number after minus sign in JSON at position 1 (line 1 column 2) at JSON.parse () at parseJSONFromBytes (node:internal/deps/undici/...
Erenay's user avatar
  • 1
0 votes
0 answers
23 views

JSON changes in the sequelize database are not applied

I'm building my discord bot on the Discord library.js and I need to make a resource system. To do this, I decided to use the sqlite3 database in conjunction with sequelize. I use json strings to store ...
ForniLan's user avatar
1 vote
1 answer
56 views

Directory import not supported

Before now I was using CommonJS and module-alias but I want to move over to ES modules and switch to the natively supported import mappings, so I refactored to this in my package.json: { "...
ololo's user avatar
  • 2,076
0 votes
2 answers
27 views

How do i get all the values in a JSON array?

I am a new node js programmer, so help is much appreciated, I am trying to log all the buyer_sku_code but it only logs one of them which is only the "WDP" array this is the JSON [ { ...
Lyraeon's user avatar
0 votes
0 answers
47 views

How can I structure a Javascript object to record colour themes for seven items

I have an LED clock with the following elements that can take an RGB value C for Cardinal points (ie 3,6,9,12 hrs or 15,30,45,60 mins) F for One hour/Five minute points (ie 1,2,4,5,7,8,10,11 hrs or 5,...
Greg's user avatar
  • 347
-1 votes
1 answer
84 views

Using React to write into Json file

So im trying to create a small cafe website using react. customer told me that he wanted his orders to be be visible on admin dashboard, so i thought i would make something like this: import React ...
george tavadze's user avatar
0 votes
1 answer
59 views

Get Inbox Email using Nylas (only important email filter!)

Im using Nylas to curl the last 5 Emails for a Web Project. The issue I have is that its list from all mails i got, the last 5 (Spam, Advertising or Buisness) mixed. Is there maybe a nother solution? ...
LinusNeedTechTips's user avatar
-4 votes
1 answer
42 views

Node JS Sends html as response instead of JSOM

I have a node js app in VPS and static files are served from dist folder (react app build files). However when i make a http request from my client, I get html as response instead of JSON const ...
adithyan sivaraman's user avatar
0 votes
0 answers
65 views

Compilation of different data types that is planning to transport over the network with HTTP

I am using the flutter_quill plugin, and I can transfer the content locally from the Flutter Quill editor to another Flutter Quill editor, and it serves read-only purposes. The content of Flutter ...
DevQt's user avatar
  • 744
0 votes
0 answers
45 views

Get the specific value from array list based on the key value in Javascript [duplicate]

I have an array of below type, [{ "type":"G", "amount":"123", "penamount":"110" },{ "type":"N", "amount&...
H Varma's user avatar
  • 650
1 vote
1 answer
27 views

Should JSON naming standards require renaming everything from database result?

I use camelCase as a JSON naming convention for keys (as do many others e.g. Google). This is fine if I am creating a new object to be send to the client as JSON. However some data comes from the ...
volume one's user avatar
  • 7,573
0 votes
0 answers
48 views

How to implement an API according to existing schema in Open API format

So I got handled a API scheme. It looks something like this: { "openapi": "3.0.0", "info": { "title": "Example API", "version": &...
oderfla's user avatar
  • 1,797
0 votes
1 answer
161 views

trying to test my Lambda function but keep getting this error "errorMessage": "\"[object Object]\" is not valid JSON",

I am making a lambda function for my react app. Its actually a video streaming service. The users can upload video through the react app using the upload button. The upload button in the react app ...
A_beginner's user avatar
0 votes
1 answer
33 views

Vuetify: Nested v-for for making lists in cards

I am attempting to create Recipe Card Components using data from a JSON file. I can successful get the cards to render with the correct data. However in the JSON file each recipe contains a nested ...
NingenIsu's user avatar
-2 votes
2 answers
177 views

SyntaxError: Unexpected token in JSON.parse - Invalid JSON format being sent in to the Backend

To give you some context: I am trying to implement a simple Crud with a Client/Server architecture. While doing so I tried making a multi-step form, since a lot of the forms became quite long. But, I ...
yzkael's user avatar
  • 307
0 votes
0 answers
411 views

"Error: Cannot find module 'aws-sdk'\nRequire stack:\n- /var/task/index.js\n- /var/runtime/index.mjs" despite me adding a dependency to the sdk

I have upgraded my nodejs runtime on my lamdba function today from 10x (very outdated I realise) to 18x and I am getting the following error: "Error: Cannot find module 'aws-sdk'\nRequire stack:\...
FrontPageRob's user avatar
1 vote
1 answer
25 views

React fetch raising SyntaxError

I have a node server running on my own home server with access via noip. http://bmraapi.ddns.net/fuel/acceptances/fuel/BIOMASS/y/2024/m/08/d/11 will return data in chrome and postman. However when I ...
NigeH's user avatar
  • 55
0 votes
0 answers
473 views

"Expected double-quoted property name in JSON at position 32"

I learn more about node.js and fastify when 'send request' the request return this message : "Expected double-quoted property name in JSON at position 32" how i know where is the problem? ...
user27208800's user avatar
-1 votes
1 answer
72 views

Convert a XLSX to Json using NodeJs and XLSX package

Here is my full scenario: I have a static site hosted on S3. Its just an interface for uploading an file. The upload is done using API Gateway as an endpoint, that triggers an lambda function. This ...
Pablo Costa's user avatar
0 votes
2 answers
38 views

Issues with Emitting Events to Socket.IO Server on Different URLs and JSON Data Conversion

I am working on a Node.js backend project using Socket.IO and am facing two issues when trying to interact with the Socket.IO endpoints via Postman: 1. Connection and Event Emission Issue on Different ...
azam45's user avatar
  • 352
1 vote
1 answer
109 views

How to find object without existing property with JSONPath

I have the following json : { "data": [ { "name": "Peter", "excluder": 1 }, { "name": "Sansa" } ...
B Jam's user avatar
  • 145
0 votes
1 answer
323 views

How to use require() in React

I'm new to React. I was wondering how to read and write to JSON file and most people use require(fs) etc... I know that require is not standard browser function (or Reacts) but I'm confused how to ...
Menethil's user avatar
0 votes
1 answer
105 views

Should TypeScript downcompile named import attributes?

TypeScript 5.3 introduced support for import attributes. When building an ESM project, the compiler allows using named imports, but I don't know any javascript runtimes that support this. Should ...
MDMower's user avatar
  • 859
0 votes
1 answer
29 views

How to generate xml doc from json object with nested array?

I am trying to generate xml doc from js object in env node.js. My js object likes: { "root": { "id": 12, "title": "root title", &...
Willi's user avatar
  • 407
-1 votes
1 answer
27 views

Why can't a replacer function (argument for JSON.stringify) detect a (node) Buffer instance?

I have tried implement a replacer function for JSON.stringify() that detect if a value is buffer or not, but, when JSON.stringify call back my replacer, it is not a buffer anymore. Why? Of course i ...
felipeaf's user avatar
  • 404
0 votes
1 answer
178 views

In CASL for ABAC, how do you pass dynamic conditions in the JSON?

I want to pass conditions into CreateMongoAbility through a JSON object, being specified in a database somewhere. In the documentation it looks easy: { "action": 'delete', "subject&...
Rob's user avatar
  • 1,579
0 votes
0 answers
22 views

React problem with setting data into constant [duplicate]

I have piece of code to put image URL from server part into JSON payload. I'll show you what it looks like in code and what output gives the browser: const url = `${apiUrl}/api/image/${barcode}`; ...
daweek's user avatar
  • 1
0 votes
3 answers
81 views

How can I store the response of my axios get request as json in node.js?

I'm trying to send a request to an api using axios and store the json response in a variable. When I output the response to the console, it shows it, but when setting a variable equal to it and ...
LanSsd Sdftytgk's user avatar
0 votes
0 answers
72 views

Accessing API in Node to the React NextJs throwing error

import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";^^^^^^ SyntaxError: Cannot use import statement outside a moduleat wrapSafe (node:internal/modules/cjs/loader:...
Mohan Mickel's user avatar
1 vote
1 answer
37 views

Import JSON as a variable only to get its type and ensure the import gets removed when compiled

I have a JSON file that is auto-generated in my repo, a TypeScript backend project with Node as target runtime. I import the JSON file like this, just to get the type of the JSON object: import ...
v-moe's user avatar
  • 1,443
-1 votes
0 answers
16 views

Exception caught by widgets library ═RangeError (index): Invalid value: Valid value range is empty: 0

i am having this error i tried to use list of cart from api getcartproducts to store in products list then to use in my widgets i don't know what is the issue! if some one can help me i am not expert ...
MOHAMED AMIIN ABDI AADAN's user avatar
0 votes
1 answer
41 views

How to test links in a JSON file?

I have a database in JSON containing multiple links and I cannot find a library to crawl it for valid and invalid links. I want to test each URL inside to look for broken links. Property example: { ...
djibe's user avatar
  • 3,038
0 votes
0 answers
45 views

I get a Cannot POST /login error when i'm not sending a POST request to the /login endpoint

I'm building a web application where users can register and login using Node.js, Express, and a PostgreSQL database. However, I'm encountering an issue with my frontend and backend communication. When ...
rbt's user avatar
  • 1
1 vote
2 answers
60 views

What is the difference between using express.urlencoded() with extended set to true vs set to false + manual JSON stringify/parse calls?

In my NodeJS/Express server I must choose between setting extended to true or to false for the urlencoded middleware: app.use(express.urlencoded({ extended: true/false })); I understand that if we ...
Oscar's user avatar
  • 590
0 votes
0 answers
41 views

How to handle circular references in TypeScript when serializing objects to include `$ref` annotations

I have an object structure where circular references need to be represented using $ref annotations in the output. Here is an example of the input and expected output :- Input is - const obj2 = { ...
Rohit Desai's user avatar
0 votes
0 answers
61 views

Why is my AJAX request not working in Node.js and Express project?

I'm trying to make a request using ajax to my backend, but it always returns a 404 error, but my route exists. Project structure: public -scripts --script.js routes -chats.js views -chats.ejs index.js ...
Gomaink's user avatar
0 votes
1 answer
445 views

FedEx API Rate Quote Returns 404: "The resource you requested is no longer available"

I'm trying to integrate the FedEx API to get shipping rate quotes in my Node.js application. I've followed the documentation, but I'm consistently getting a 404 error with the message: "The ...
Bigshow77's user avatar
1 vote
1 answer
95 views

ts-node shadows import path with JSON files, but TypeScript does not raise issue at compile time

When the "resolveJsonModule" compiler option is specified, TypeScript appears to have very unusual behaviour if a JSON file has the same name as a TypeScript file: myModule.json { "...
Maddy Guthridge's user avatar
0 votes
0 answers
15 views

HTML Static S3 site triggers APIG & Lambda & SES - but JSON field content not coming through into email

Have S3 Static site configured Contact form triggers API Gateway to Lambda to SES When receiving the email - all field content is 'undefined' Website is successfully triggering lambda and SES Postman ...
Jack Creager's user avatar
0 votes
2 answers
113 views

FormatException: SyntaxError: Unexpected end of JSON input

I am getting this error in my flutter app during the api integration phase. I have checked the backend apis through postman they are working fine. But when i integrate it with frontend and then check ...
Octyl Acetate's user avatar
0 votes
0 answers
44 views

Transforming request query with '%' character in parameter

My application is using the following request's handling chain: Nginx Server -> Nest.js HTTP controller -> Nest.js service and PostgreSQL connection. It supports sending parameters for filtering ...
TwittorDrive's user avatar
0 votes
1 answer
27 views

How to append string to array inside a few objects of a JSON file in Node.js

I am making a Node.js server that stores JSON files with complex data, and I'm having trouble appending a string to an array deep into the JSON file. Node.js code block: io.on("connection", (...
Floor Mann's user avatar
0 votes
2 answers
453 views

How to make user data persistent in local storage in electron-app?

I'm building a tasks-to-do application using electron. As I'm new using it, I have found a lot of problems to make the tasks already uploaded persistent in the application. I'm creating the tasks ...
MavapeGZ's user avatar
-1 votes
1 answer
194 views

Unable to Load JSON Schema References in package.json and .babelrc

I'm encountering issues with JSON schema references in my package.json and .babelrc files. Here are the details: Error in package.json: I'm getting the following error under the first bracket in my ...
Julius Ametsitsi's user avatar
0 votes
0 answers
28 views

Error while starting the react-native app

The project was working fine, untill I added some new packages. Now, when I try to start the app, it give me the following error: Error: Problem validating fields in app.json. See https://docs.expo.io/...
Rohit kc's user avatar

1
2 3 4 5
236