zehfernandes / get-vercel-source-code

Get source code hosted at vercel
99 stars 22 forks source link

HTTPError: Response code 500 (Internal Server Error) #14

Open DrigaNicolai opened 9 months ago

DrigaNicolai commented 9 months ago

I have followed all the instructions, specified the correct token, but everything stops at the stage of Loading source files tree giving error 500 image

zehfernandes commented 9 months ago

It is working in my tests.

What are the vercel url are you using?

DrigaNicolai commented 9 months ago

I tried two links, the first one is a commercial project, so I can't share it, the second one is my test project, I can share it if needed

DrigaNicolai commented 9 months ago

@zehfernandes I have tried installing a newer version of node js, but I still encounter this error. I get as the deployment url this value image am I right? (test project deployment url from the screenshot: nextjs-locofy-real-estate-j207zulc0-driganicolai.vercel.app)

zehfernandes commented 9 months ago

hmmm the URL is right.

I couldn't reproduce the error with my test projects.

Maybe if you have time we can add some console.logs (https://github.com/zehfernandes/get-vercel-source-code/blob/main/index.js#L63) to this function and paste here the outputs to help me understand more about the error and try to fix the issue.

DrigaNicolai commented 9 months ago

I added a couple of console logs:

async function getDeploymentSource(id) {
  console.log(id, "id");
  let path = `/v6/deployments/${id}/files`;
  console.log(path, "path");
  if (VERCEL_TEAM) path += `?teamId=${VERCEL_TEAM}`;
  const files = await getJSONFromAPI(path);
  console.log(files, "files");
  // Get only src directory
  const source = files.find((x) => x.name === "src");
  console.log(source, "source");
  // Flatten tree structure to list of files/dirs for easier downloading
  return flattenTree(source);
}

and this is the result:

image

Seems to be an issue in getFromAPI function

gerardo-contijoch commented 9 months ago

I'm having the same issue, but it seems the problem is on the API side. I tried the same request using Postman and Invoke-WebRequest Powershell api and got a 500 error after a couple of minutes.

Screenshot 2024-02-14 185519 .

Piliponful commented 5 months ago

Same for me. Also tested with plain curl copied from vercel docs and it didn't work. So it seems to be a problem with their API and not this repo code.

lawbyte commented 5 months ago

image im facing the same issue, please help @zehfernandes

sekedus commented 3 months ago

This only works if deploying project from Vercel CLI

anthonyyoussef01 commented 1 week ago

It's not working for me and the project was deployed using Vercel CLI