Skip to content
Advertisement

Vercel CLI issue with localhost

I have installed Vercel CLI to test a serverless function locally.
The repository is this: https://github.com/LuigiImVector/github-badge/tree/eda8e1954fc81d69142c461b89f32e9f7635f6f2

With vercel dev I started the localhost server but there is a problem. The homepage (index.html) is loaded correctly but when I go to http://localhost:3000/api or http://localhost:3000/api/index.js an error appears.

image-error

The entire error message that appears in the console is this:

JavaScript

In the site on Vercel everything works perfectly (https://github-badge-three.vercel.app/api?years=9) but in localhost does not.

Advertisement

Answer

Update Vercel CLI: npm install -g vercel (if this doesn’t work try npm install -g vercel@canary)

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement