454 questions
0
votes
0
answers
47
views
axios timeouts without any reason?
I'm trying to use axios to download this file (and headers):
http://daten-hamburg.de/opendata/3d_stadtmodell_lod2/LoD2-DE_HH_2023-04-01.zip
using this getlastModified function:
axiosRetry(axios, {
...
0
votes
0
answers
39
views
Cannot orchestrate typescript + node + ESNext modules
UPDATE now includes an answer!
So I want to publish a typescript module, but I have an either-or problem importing the modules I need or exporting the module correctly.
Here is a minimum repro case, ...
0
votes
0
answers
55
views
Tweet Scraped Data Disorganized
So, I've been recently using Twitter's backend API, which is used to display tweet/user data on a webpage to scrape and try and find a user's latest tweet. The main issue I'm having with this is that ...
0
votes
1
answer
164
views
teams toolkit deploy failed with node-fetch
I have created a new app using VSCode teams tools kit v5.8.1
The app is the bot application connected to Function app
when I start debugging by clinking both debug in teams and debug in test tools
I ...
0
votes
0
answers
128
views
Node.js Fetch Error: getaddrinfo ENOTFOUND
I'm encountering a DNS resolution error when trying to fetch data from Unsplash using Node.js. Here are the details of my setup and the error message I'm seeing:
const fetch = require('node-fetch');
...
0
votes
0
answers
108
views
SvelteKit fetch from static throws 500 on production
Im creating an sveltekit app that fetches json from /static/schemas/{param}.json
The schemas folder will contain hundreds of json files so I really dont want to import it.
Example route: http://...
0
votes
1
answer
30
views
Jest, typeOfEnv is node, polyfill with node-fetch, complains about require() when clearly using import
Node v16.20.2
package.json:
{
"private": true,
"name": "baffled-i-tell-you",
"version": "0.1.0",
"main": "index.js",
&...
0
votes
0
answers
94
views
Can I tunnel HTTPS requests through a Node.js proxy server, using node-fetch without extra modules?
I have a HTTP proxy server like so
ProxyServer = http.createServer((request, response) => {
console.log("connection established");
console.log("request", request);
res....
0
votes
0
answers
100
views
sveltekit node-fetch localhost 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'
I have been running a sveltekit app in Vercel for a couple of days without any problems. Debugging in VSC (Windows) via localhost was not a problem either until recently. Now when I debug I always ...
0
votes
0
answers
294
views
globalThis.fetch resolves to node-fetch (an indirect dependency) in a next.js project using pnpm
import ky from 'ky'
import { NextApiRequest, NextApiResponse } from 'next'
export default async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
await ky.get("https://google....
0
votes
1
answer
51
views
node-fetch to return bearer token
I am trying to use node-fetch to return the bearer token in a function. I am having issues though and the following:
import fetch from 'node-fetch'
export class APIToken {
async getToken() {
...
0
votes
0
answers
502
views
Fetch failed on Docker, but works fine locally
I have the following simple Node app:
import dotenv from "dotenv";
import { Client, GatewayIntentBits } from "discord.js";
dotenv.config();
const client = new Client({
...
0
votes
0
answers
100
views
node-fetch hangs with uploading files using FormData
I'm stuck with the seemingly simple task of posting a file via FormData using node-fetch.
The code below does work with tiny files (~1.5 KB). With slightly bigger files (i.e. >= ~69 KB), it prints ...
1
vote
1
answer
131
views
400 bad request error posting thru node-fetch
const fetch = require("node-fetch").default;
let iApi = express.Router();
iApi.post("/update/:name/:value", async (req, res) => {
...
0
votes
0
answers
97
views
504 gateway error after node-fetch migration from request library
This is Javascript
const fetch = require("node-fetch").default;
let iApi = express.Router();
iApi.post("/update/:name/:value", async (req, res) => ...
1
vote
0
answers
43
views
HTTP1.1 is timing out on some urls
I am using npm module node-fetch to call online shop URLs; some are timing out.
This happens when the call is made with http1.1 which is used in most API npm modules such as node-fetch. Can someone ...
0
votes
1
answer
728
views
node-fetch and axios GET call hangs forever
I have this small node-typescript project that gets a bunch of links from shops like ikea, homedepot and amazon from google sheets, makes fetch calls to get some information from a product, and then ...
-3
votes
2
answers
278
views
Why is my GET Request getting hung up in Node using Fetch [closed]
getDocuments request never completes/stays pending. What am I missing?
App.js
import React, { useState, useEffect } from 'react';
import Grid from './Grid';
import apis from '../api/index';
export ...
1
vote
1
answer
454
views
How call local endpoint from .js file in svelte
I have this routing structure in svelte
lib
addLog.ts
routes
+page.svelte
remote
log
+server.js
Server.js is not important as it uses fetch() to call REMOTE api, and add log entry. But it has ...
0
votes
1
answer
1k
views
How do I use a specific TLS version with `node-fetch` like TLS v1.2?
I'm getting a 403 FORBIDDEN error and need to set the TLS version to TLS v1.2 with fetch calls using the node-fetch library. How do I do that?
1
vote
1
answer
562
views
"Can't resolve 'encoding'" warning in NextJS caused by try/require from `node_modules`
In a NextJS 13.4.19 app in typescript, using @apollo/[email protected] causes a warning at the build step, coming from ApolloServer/node-fetch. This seems caused by a try / require in node-fetch:
./...
0
votes
1
answer
699
views
Node.js http/node-fetch ETIMEDOUT no longer works
I'm writing an API in Node.JS to protect my API keys for a basic weather app SPA.
Initially my http requests got through fine. The next day (today), with no changes to the request, it fails and I am ...
0
votes
0
answers
667
views
When I introduced node-fetch in my codebase I get 'import_node_fs.promises' as it is undefined
I am working on a Vite project with React and I am trying to make a request with node-fetch. I have installed the dependency as described in the docs but I am getting this logs on browser console.(...
0
votes
0
answers
290
views
Mocking method response with Jest spies and spying on node-fetch arguments [duplicate]
I have one object (ConvertkitServer) that contains two methods: addSubscriberTags() that calls getConvertkitTags(). Both use fetch() and the scope of this question is limited to the tests I’m creating ...
0
votes
1
answer
178
views
request to https://api-m.sandbox.paypal.com/v1/oauth2/token failed, reason: unable to get local issuer certificate, nodejs, cPanel
I'm creating a nodejs app with paypal buttons.
The app works on local computer just fine, but I have problems with integrating it with cPanel. The application works as a server behind the passenger ...
2
votes
1
answer
2k
views
Node.JS 18.16.1 -> Fetcherror: Unsafe Legacy Renegotiation
I am getting following error when trying to make an API call to the vendor server.
The issue I am facing is my code works when using node version 16 and following error is encountered when using node ...
1
vote
0
answers
75
views
uploading using form-data a remote file
in my node application I want to use FormData to upload a remote image.
To do this I'm trying the following
const form = new FormData();
...
const result = await fetch(image);
form.append(&...
1
vote
1
answer
1k
views
How to fix the ECONNREFUSED NodeJS( + NEST ) error when making fetch request in a dockerized node server?
I am trying to make a fetch request using a dockerized NodeJS( + nest framework ) (version 16.20.0) server.
The docker image contains a strapi container running on http://localhost:1337/ and ...
0
votes
3
answers
979
views
Inspecting outgoing HTTP requests in a nodejs application [closed]
I am using NestJS to build a web app from which I call an external API to retrieve data. Now, I want to inspect all the requests that are sent from my app. For example, in a web browser, I can inspect ...
1
vote
0
answers
216
views
How to get redirected query parameters into nodejs?
I am working on an app to track our outbound UPS packages using the UPS API. For those that do not know, they are implementing a OAuth token system to authenticate requests. This article shows the ...
1
vote
1
answer
554
views
Accessing zabbix API with node-fetch
I am trying to access Zabbix API from a Node.js app with the following code:
fetch(
"http://localhost:8080/api_jsonrpc.php",
{
method: "POST",
headers: {
"...
1
vote
0
answers
567
views
Transform FS createReadStream to native ReadableStream (for native NodeJS fetch)
This script is how I always uploaded files to server, but I would like to remove dependecy on node-fetch library and it has confilicting types of streams.
import {createReadStream} from 'fs';
declare ...
0
votes
1
answer
49
views
Cannot read properties of undefined (reading 'length') discord.js
Attached below is my code. It works the first time it is run but not the second time.
const { Client, GatewayIntentBits } = require('discord.js')
const client = new Client({
intents: [...
1
vote
1
answer
677
views
Why does this API request return different things with node-fetch than with node's inbuilt fetch?
I have a node app which sends an api request to trigger a bet on Manifold (a fake betting site).
When I use node-fetch it makes a bet.
When I use the inbuilt fetch it returns an old version of the bet ...
8
votes
0
answers
4k
views
Webpack configuration with node-fetch is giving "node:buffer" is not handled by plugins
I am trying to implement node-fetch with a react app and Webpack setup. But on using the node-fetch. I am getting tons of errors.
ERROR in node:buffer
Module build failed: UnhandledSchemeError: ...
0
votes
1
answer
2k
views
Discord.js | How can I fetch users linked accounts information
I'm trying to code a bot that fetch data from faceit link user give and compare it with users linked Riot Games accounts username. I want to check if user connected his Discord account to Riot Games ...
6
votes
2
answers
6k
views
Differences between Node standard https and node-fetch when providing a certificate
ADP's REST API requires that a SSL certificate and private key be sent with every request.
When I use the 'standard, Node.js HTTP(S) module:
require('dotenv').config()
const fs = require('fs')
const ...
1
vote
1
answer
948
views
curl returns expected result, but node-fetch doesn't
I want to scrapping shopee with node-js
ex)https://shopee.co.th/Erb-Eastern-treat-Body-Oil-240-ml.-%E0%B8%AD%E0%B8%AD%E0%B8%A2%E0%B8%A5%E0%B9%8C%E0%B8%97%E0%B8%B2%E0%B8%9C%E0%B8%B4%E0%B8%A7-%E0%B8%81%...
0
votes
1
answer
218
views
send very big data to an api in parallel and catching errors within promise.allSettled
I have quite big data, to be sent to an api with node-fetch. But, since there are many data in the array, and I want to send the data in parallel, I wanted to use promise.allSettled...
Yet, it still ...
0
votes
0
answers
236
views
Getting ERR_TLS_CERT_ALTNAME_INVALID error
import {Router} from 'express'
import fetch from 'node-fetch'
const tasks=Router()
tasks.get('/', async (req,res) => {
const response= fetch('https://dummy-api')
res.json(response)
})
I am ...
0
votes
0
answers
79
views
Fetching characters with node-fetch
I am writing a browser application in ReactJS that should manipulate and display data from robot Wifibot Lab. It sends me 21 chars from which every one of them stands for the status of different ...
1
vote
0
answers
117
views
How to login to a Spring login form using node-fetch
I have access to a Spring application via a username and password from my browser and I want to login from a NodeJS application.
I followed the post (How to login to a spring security login form using ...
2
votes
1
answer
910
views
Can I substitute dependencies for a module (for example, replace node-fetch with the inbuilt fetch) using Vite?
I have a number of packages that depend on node-fetch:
$ npm ls node-fetch
[email protected] /home/mike/Code/[email protected]
├─┬ @metaplex-foundation/[email protected]
│ ├─┬ @bundlr-network/[email protected]
│ │ └─┬ near-...
0
votes
0
answers
29
views
after GET https://some.com/some prisma.some.findMany() crashed with exit code -1073741819 (0xC0000005)
if
// any
prisma.some.findMany() // all ok
if
// any
const some = await axios.get('https://some.com/some') // or nestjs/axios or node-fetch
console.log(some)
// ...
...
1
vote
1
answer
193
views
Can you use PollyJS with Node 18 native fetch?
I've been using PollyJS to record HTTP traffic via node-fetch and it's working well and as intended.
I'm currently chasing my tail trying to switch this out for Node 18 native/built-in fetch which ...
0
votes
0
answers
88
views
node-fetch i trying get data but the execution still running and not returns
If i run the same request in postman it gives me a return in 9 minutes, with a 39mb of json data.
"node-fetch": "^2.6.7"
Same results with
node v16.6.2
node v17.9.1
const fetch = ...
0
votes
1
answer
112
views
Getting the error "SyntaxError: Unexpected token u in JSON at position 0" when fetching random posts from a subreddit
When I try to fetch a post from https://www.reddit.com/r/hoodironycentral/random/.json it returns me undefined while JSON.parse is running.
Here is my code:
import { EmbedBuilder, PermissionsBitField, ...
1
vote
1
answer
1k
views
'TypeError: Protocol "http:" not supported. Expected "https:"' error when fetching HTTPS site
I'm trying to use node-fetch to capture the contents of a page, and running into an unexpected error. I checked a similar question but it doesn't seem relevant. I am trying to fetch a HTTPS site ...
0
votes
1
answer
292
views
script type="module" not console.log anything? in node-fetch
I am Using node-fetch for some reason, I do it on simple HTMl and js not npm install. I want to use it with cdn. below attachments, I used this approach and not logging anything.
In html
<script ...
0
votes
1
answer
45
views
Preserving data in a fetch request in node js
Oilà,
I'm a beginner with nodejs and I am using it to create a telegram bot. This is my code:
const Geolocation = (req) => {
var address = "15 Freedom Way, Jersey City, NJ 07305, ...