Getting error Fetch failed, cause: unable to get local issuer certificate
Unanswered
୧ʕ•̀ᴥ•́ʔ୨ posted this in #help-forum
I am running
Any ideas what else to try?
next dev --experimental-https
and can access the page locally via https://localhost, but the fetch still fails. If I put process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"
in next.config.js is works, but this isn't recommended from what I've read.Any ideas what else to try?
14 Replies
you gotta need
NODE_TLS_REJECT_UNAUTHORIZED = 0
if you don't have a signed cert for the serverIsn't --experimental-https meant to resolve this?
It added a /certificates/ folder
I have localhost.pem and localhost-key.pem in it
I think it just generate the cert for you
but it is not signed/trusted
Hmm, seems like a pain to get it to work
Is it bad to run
NODE_TLS_REJECT_UNAUTHORIZED = "0"
in development?oh i just tried, and it is an signed cert
what do you get error from?
It's an image, I have this in my next.config.js
remotePatterns: [
{
protocol: "https",
hostname: "cdn.sanity.io",
port: "",
pathname: "/**",
},
],
remotePatterns: [
{
protocol: "https",
hostname: "cdn.sanity.io"
},
],
does this work?
No :/ It works fine if I set NODE_TLS_REJECT_UNAUTHORIZED = "0"
well I think its fine to have NODE_TLS_REJECT_UNAUTHORIZED in dev mode