Home > front end >  I can't deploying my app with next js and firestore
I can't deploying my app with next js and firestore

Time:11-06

When trying to deploy my application with npm run build or in vercel or another service it doesn't allow me, but in localhost it works fine and doesn't show errors I use firebase, next js and typescript, the error is something related to getStaticProps what do I do to my Api, apparently when I request data it returns undefined, but I have already done many things, I would greatly appreciate help..

Repository: https://github.com/SrAndresF/a

Error:

Collecting page data ...AxiosError: Request failed with status code 404 data: undefined code: 'ERR_BAD_REQUEST'

I already tried changing the headers and it still doesn't work for me, something related to a pre-rendering of the page appeared, I also tried to deploy it in firehosting and it doesn't work either, I also thought it was a getStaticPaths problem and I searched a lot and apparently it's not bad, the site uses a cookie in environment variable so I don't think that's the problem

i taste Json.stringify could it be that i need to open a docker? Thanks :)

CodePudding user response:

Error 404 means that the endpoint that you are looking for does not exist.

Please, check the hostname and port you're using in the code. Vice versa the method used is correct otherwise you get the same error even with localhost.

To make things easier, you can use Postman first to check the remote API connection and then retry with your code.

Checking your code, look inside the config/index.ts file the line:

export const server = dev ? 'http://localhost:3000' : 'http://clubdragones.vercel.app'

to check:

  • Related