All Questions
540 questions
-3
votes
0
answers
61
views
Express route /api/test returns 404 Not Found even though it’s defined
I have a simple Express server listening on port 5002. In my server.js I’ve defined a test endpoint:
// server.js
import express from 'express';
import cors from 'cors';
const app = express();
app....
0
votes
1
answer
100
views
CORS Issue When Using External Service for API Calls in Next.js"
I am encountering an issue with Next.js that I don't quite understand. I have a service file that I want to use to make API calls faster and more structured. However, when I call the API via this ...
2
votes
0
answers
38
views
Client side request for monero-wallet-rpc with credentials
I wonder how to create a axios request from client side for monero-wallet-rpc with --rpc-login credentials because all of my tries are failing with response status code 401. Below is my sample command ...
0
votes
0
answers
12
views
xsrf token is not send to api
I'm developing an app with docker, nginx, laravel and nextjs.
Next is running in localhost:3000 and nginx in localhost:9000, and I have the problem when a form is sent, the token is not added ...
1
vote
1
answer
43
views
Interceptors.request unable to add a request header
I have a react nextJS project, and the following code:
import axios from "axios";
import config from '@/app/settings/config';
import { configConsumerProps } from "antd/es/config-...
0
votes
1
answer
143
views
Next redirect gives error when trying to redirect 401 errors from Axios Interceptors
In my project where I use Next JS 15 and React 19, I am trying to redirect using next redirect from the interceptor. But when I try to make this redirect:
Error: NEXT_REDIRECT
at <unknown> (...
0
votes
0
answers
52
views
Fetching data with axios/server actions/authentication cookies
I have a REST API/Express + NodeJS (backend) and a Client Site/NextJS(frontend) and the authentication between them is done through JWT.
My REST API returns accessToken and refreshToken through ...
0
votes
1
answer
51
views
Set type error try catch on typescript except error.message
I created a custom error message sent from the server side, of course I don't just use
error.message
to get the message. So I use
error.response.data
to get the message and get an error like the ...
1
vote
1
answer
79
views
How can I access a cookie (refreshToken) on the server side in Next.js?
I'm trying to refresh the access token of a user when it expires by making a request to the backend Express server. To do this, I need to send a request to /auth/updateAccessToken and include the ...
0
votes
0
answers
230
views
Next.js 15 App Router: How to implement Axios interceptor as a custom client component with token refresh?
I'm working on a Next.js 15 project using the App Router and trying to implement an Axios interceptor as a custom hook to handle authentication and token refresh. My current implementation is losing ...
1
vote
3
answers
302
views
Issue with Replicate.ai API Returning ReadableStream Instead of Image URL in Next.js
I'm working on a Next.js project that generates images using the Replicate.ai API. Although images are generated correctly on the Replicate.ai dashboard, the API response in my Next.js serverless ...
2
votes
0
answers
375
views
Axios in NextJs client and server best practice
I'm new to NextJS and i need a best practice.
I give you an explanation then tell you about my problem.
Explanation
I want to use Axios with interceptors that works for both client and server.
I ...
0
votes
0
answers
46
views
Next.js not reflecting updated backend data unless I redeploy on Vercel
I am working with Next.js for the first time and using Axios to fetch data from a backend API. The issue I’m facing is that after I update data in my backend, the changes are not reflected in my app ...
-1
votes
1
answer
46
views
How do I get the cookies without having to pass them to API functions from server components?
I can get the cookies in server side components and pass them to API functions like this:
import { cookies } from 'next/headers';
const cookieStore = cookies();
const sessionId = cookieStore.get('...
0
votes
0
answers
8
views
React - Axios not attaching session cookies in requests
i have this 2 endpoints in backend nestjs app:
@Post(authPaths.login)
@UseGuards(LocalGuard)
async login(@Req() req: Request, @Res() res: Response) {
const user = req.user as User;
const tokens = ...