6,214 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
66
views
following vue code will cause memory leak, but I don't know the reason
<script setup>
import { ref, onMounted, onBeforeUnmount, toRefs } from 'vue'
const props = defineProps({
sessionUrl: { type: String, required: true },
offerData: { type: Object, required: ...
1
vote
1
answer
96
views
Can AbortController be used with Fetch Post requests without automatically triggering a close event?
Question: Is it possible to use AbortController with POST requests without immediately triggering a 'close' event on the server? If not is there a more appropriate tool / method to cancel post ...
-1
votes
1
answer
67
views
Failed to fetch when GETting json file from backend using Jwt Token [closed]
I am using a spring boot as backend and react frontend to create a website and I am encountering an error when fetching a user profile using browser from the backend.After login i managed to generate ...
-3
votes
1
answer
132
views
how do I get html page with fetch for reload part of the page?
I am getting data from the server. The view must renders an html page without reloading the entire page، but this renders whole page including the header of current page, this is a problem, each time ...
1
vote
2
answers
89
views
Why is my fetch POST request returning 415 Unsupported Media Type?
I’m trying to send a JSON payload to my backend API using fetch in React, but the server keeps returning:
415 Unsupported Media Type
Here is the code I'm using:
const sendData = async () => {
...
0
votes
1
answer
177
views
Why does CORS apply to local files? And is there a way to just disable it? [duplicate]
I have been working on a personal project for a while now and during a testing phase for a database, it began reporting that CORS was preventing the file from being fetched, and stopped my testing in ...
0
votes
1
answer
103
views
javascript fetch and redirect through flask view not working as expected
In the html intro to a web app for a scientific study, data is collected through forms.
I added a javascript function that submits the data via the fetch API:
fetch('/prepare/', {
"method":...
1
vote
1
answer
61
views
Save button in Laravel Blade + JavaScript fetch not triggering (no console log, no network request)
I’m working on a Laravel Blade view (monitoring.blade.php) where I have an edit and save button for each row. The edit button works, but when I click the save button, nothing happens — no console logs,...
4
votes
1
answer
141
views
Why I cannot send body with a fetch request when mode is no-cors?
Trying to make a cross-origing fetch request with the no-cors mode I found out it is not possible in this case to send any data to the server as a body:
const url = 'http://cross-origin-example.com/...
0
votes
1
answer
81
views
TMDb API Error: signal timed out when fetching popular movies
Problem:
I’m trying to fetch popular movies from the TMDb API in my Next.js project, but I keep getting a signal timed out error.
Here’s the error log:
TMDb API Error: signal timed out
at ...
1
vote
0
answers
122
views
Why does my API call in Next.js return undefined even though the Express backend works fine?
I’m building a small full-stack project using Next.js (frontend) and Express.js (backend) with a MySQL database.
The Express backend has this route:
// server.js
import express from "express&...
0
votes
1
answer
88
views
Why doesn't useState update correctly in my custom useFetch hook?
I'm trying to write a custom React hook that fetches data. It seems to work partially — but loading goes false before data is set, and error is never set even when a request fails.
import { useState, ...
0
votes
0
answers
32
views
Importing @babel/traverse breaks files
As the title says.
This code reproduces the issue.
My environment: Windows 11, ArchWSL, Volta, [email protected], [email protected]
import fs from "node:fs";
import { Buffer } from "node:buffer&...
2
votes
1
answer
159
views
Why does setTimeout execute before fetch .then despite microtask priority? [duplicate]
I'm running the code below. The output I was expecting was:
Start -> End -> While expires -> joke -> setTimeout
However, the output I’m actually getting is:
Start -> End -> While ...
-1
votes
1
answer
68
views
Updating the cart by fetch request
I have a code for updating the quantity in the cart by a fetch() request, and I modified it a little:
updateMainItem(line, quantity, name, variantId) {
const body = JSON.stringify({
line,
...