Using @vercel/client with Next.JS, getting http error when trying to create deployment

When trying to make a deployment with @vercel/client, like this:

      let deployment;
      for await (const event of createDeployment({
        token: process.env.DEPLOYMENT_TOKEN!,
        path: tempDir,
        defaultName: `lab-deployment-${config.challengeId}`,
        },
        {
          name: `lab-deployment-${config.challengeId}`,
            autoAssignCustomDomains: true,
          
        }
      )) {
        console.log(event);
        if (event.type === "ready") {
          deployment = event.payload;
          break;
        } else if (event.type === "error") {
          throw new Error(event.payload.message);
        }
      }

I recieve this error:

 type: 'error',
  payload: Error: TypeError [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:"
      at uploadList.<computed>.retries (webpack-internal:///(rsc)/./node_modules/@vercel/client/dist/upload.js:168:

@joshiewtf Welcome to the Vercel community.

ERR_INVALID_PROTOCOL Error Common Causes

  • Incorrect URL protocol specification (missing or wrong protocol)
  • Using ‘http://’ when ‘https://’ is required
  • Missing protocol in URL configuration

Try these if it helps:

  • Always specify the protocol (http:// or https://)
  • Check environment variables for proper URL formatting
  • Verify API endpoint URLs include proper protocols
  • Ensure redirect URLs are properly formatted

Can you also confirm the URL you are fetching is http or https?

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.