4

I want to deploy on project on vercel but I keep got an error that say me the project is not valid like this message:

Error: The name of a Project can only contain up to 100 alphanumeric lowercase characters and hyphens. Learn More

but my name project is: ecommerce_sanity

or this error:

The name contains invalid characters. Only letters, digits, and underscores are allowed. Furthermore, the name should start with a letter.

for this name project: headphones_ecommerce

I try different name but keep got this error do someone already face this?

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
Ganzo
  • 198
  • 1
  • 3
  • 16
  • 1
    Can you send a screenshot of the actual error or copy it entirely – Cypherjac May 16 '22 at 21:02
  • the two examples I posted are the complete error messages provided by Vercel, it does not give me more explanation. That's why I don't understand. OPn the learn more link it just say this : Project names can only consist of up to 100 alphanumeric lowercase characters. Hyphens can be used in between the name, but never at the start or end. – Ganzo May 16 '22 at 21:14
  • 1
    Check your `package.json` and look for the name field. Does it match `ecommerce_sanity`? – serraosays May 16 '22 at 22:50
  • 2
    _"alphanumeric lowercase characters and hyphens"_ - this does not include underscores. Have you tried using hyphens instead: `ecommerce-sanity`? – juliomalves May 17 '22 at 12:49
  • @juliomalves, Yes i tried like this too same error. – Ganzo May 18 '22 at 07:51
  • @serraosays In the package.json it was only ecommerce but i figured out that it's the environnement variable that make appear the error cause when i try to deploy whithout the env variable but same name it's works so i manage to deploy the project without env variable and add them after. – Ganzo May 18 '22 at 07:53
  • If you're deploying to Vercel, define your env up there: https://vercel.com/docs/concepts/projects/environment-variables. Make sure it matches what you have locally in your `.env.local` - remember don't commit `.env.local` to your repo!!! – serraosays May 18 '22 at 17:35

5 Answers5

6

In my case it was the env_variables creating the error. When I tried to copy and paste the env_variables, some spaces were there in the env_name like: HELLO_WORLD (note the space at the end) and that was creating this error:

The name contains invalid characters. Only letters, digits, and underscores are allowed. Furthermore, the name should start with a letter.

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
kush bogati
  • 61
  • 1
  • 2
1

Rename the project name like "dummy_server" to "dummy-server". Replace underscore to hyphen. Hope it will work.

0

Just rename your github repo like "abc-abc" and it work. I had the same problem and that fixed it for me.

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
0

I faced this kind of problem and solved it by using only lowser-case characters. I removed hypens, underscore, numbers, and upper-cases. And also confirm that your project name is unique. I think your project name could be long.
And one more point, you have to remove un-using projects if you have many project with your basic plan. Or you can upgrade your vercel account to premium one.

Cardoso
  • 962
  • 1
  • 12
  • 30
0

Remove underscore and put Hyphen like this

headphones-ecommerce

or join them

headphonesecommerce

Info All
  • 21
  • 1
  • 2
  • 6