I have called this function below:
export async function getStaticProps() {
const res = await fetch("https://links.papareact.com/pyp");
const exploreData = await res.json();
return {
props: {
exploreData,
},
};
}
And it is showing the error below. How do I solve this issue?

Server Error
FetchError: request to https://jsonkeeper.com/b/4G1G failed, reason: Hostname/IP does not match certificate's altnames: Host: jsonkeeper.com. is not in the cert's altnames: DNS:www.jsonkeeper.com
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
ClientRequest.<anonymous>
file:///P:/Work/Web%20Development/airbnb-clone/node_modules/next/dist/compiled/node-fetch/index.js (1:65756)
ClientRequest.emit
node:events (527:28)
TLSSocket.socketErrorListener
node:_http_client (454:9)
TLSSocket.emit
node:events (527:28)
emitErrorNT
node:internal/streams/destroy (157:8)
emitErrorCloseNT
node:internal/streams/destroy (122:3)
processTicksAndRejections
node:internal/process/task_queues (83:21)`your text`
I was trying to call an API but its showing
type: 'system',
errno: 'ERR_TLS_CERT_ALTNAME_INVALID',
code: 'ERR_TLS_CERT_ALTNAME_INVALID',
I have installed mkcert but the problem was not solved.
You just need to add www to the jsonkeeper link
export async function getStaticProps() {
const res = await fetch('https://www.jsonkeeper.com/b/4G1G');
const exploreData = await res.json();
return {
props: {
exploreData,
},
};
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With