Everything runs smoothly in my development environment (when I run yarn dev). And I can even run yarn run build on my local computer with no problems. I successfully deployed Strapi to Heroku, and that works well. Now, my only problem occurs when deploying the next.js blog to Vercel.
I receive an error with fetchAPI, and I'm curious if anyone else has gotten the same error, attached here.
From what I've seen on Stack Overflow, you're not supposed to fetch an API route directly from getStaticProps or getStaticPaths, but I don't think we're doing that... aren't we using a helper function fetchAPI in order to not do it directly?
If anyone has had this problem or solved it please let me know!
I believe the error has to do with making my deployed Strapi api publicly accessible. Closing this because I don't think there's any issue with the code. Thanks!
Hello!
Everything runs smoothly in my development environment (when I run
yarn dev
). And I can even runyarn run build
on my local computer with no problems. I successfully deployed Strapi to Heroku, and that works well. Now, my only problem occurs when deploying the next.js blog to Vercel.I receive an error with fetchAPI, and I'm curious if anyone else has gotten the same error, attached here.
From what I've seen on Stack Overflow, you're not supposed to fetch an API route directly from
getStaticProps
orgetStaticPaths
, but I don't think we're doing that... aren't we using a helper functionfetchAPI
in order to not do it directly?If anyone has had this problem or solved it please let me know!