Breaking news
Sweden punished in the World Cup general rep -
For sale: Absoluteblack oval front blades 34T & 36T -

Next JS Skumt error = Axios GET from localhost but works on commit

Next JS Skumt error = Axios GET from localhost but works on commit
Next JS Skumt error = Axios GET from localhost but works on commit
--

Hello

I have encountered a strange error. See below:

I have made an app in Next JS and retrieve various data from my own API. See below:


const Grid = await axios.get>(`/web/api/statistik/fetchPlockData?date=${choosenDate}`, { validateStatus: () => true });

The communication works fine to that apit but the response in the console is a bit strange –> data: “Execpetion Error: unable to verify the first certificate”

Status is 500!

Apit in turn retrieves data from a database. See below:


export const fetchPlockData = async (req: NextApiRequest, res: NextApiResponse) => { const { date } = req.query; try { const plockOrderRes = await axios.get('https://xxx.xxx.xxx/xxxxx/ASPlock/GetPlockOrder', { validateStatus: () => true }); console.log('plockOrderRes :', plockOrderRes); ………………………………………………………………… ………………………………………………………………… ………………………………………………………………… ………………………………………………………………… ……………………………

I log and the function runs empty try { but when axios tries to retrieve the data, the execution is stopped after i.e. no more logs are displayed

X stands for something I can’t show.

I can share some code if you need it.

Etc. Fredrik

The article is in Swedish

Tags: Skumt error Axios localhost works commit

-

PREV For sale: Commencal Ramones 20″ | Happyride.se
NEXT For sale: Disc brakes with four-piston calipers, Shimano 11-speed rear derailleur with controls, handlebar/stem 35mm