Can't deploy project on Vercel due to name error
Asked Answered
R

6

6

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?

Robbyrobbyn answered 16/5, 2022 at 20:56 Comment(7)
Can you send a screenshot of the actual error or copy it entirelyAldose
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.Robbyrobbyn
Check your package.json and look for the name field. Does it match ecommerce_sanity?Formant
"alphanumeric lowercase characters and hyphens" - this does not include underscores. Have you tried using hyphens instead: ecommerce-sanity?Redman
@juliomalves, Yes i tried like this too same error.Robbyrobbyn
@Formant 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.Robbyrobbyn
If you're deploying to Vercel, define your env up there: 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!!!Formant
M
7

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.

Mabuse answered 18/8, 2022 at 15:6 Comment(0)
C
1

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

Chigger answered 22/10, 2022 at 9:54 Comment(0)
T
0

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

Tweeny answered 1/10, 2022 at 4:11 Comment(1)
You mean use a hyphen rather than an underscore? They say in the comments that they tried that and got the same error.Mastaba
B
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.

Barksdale answered 22/10, 2022 at 13:14 Comment(0)
S
0

Remove underscore and put Hyphen like this

headphones-ecommerce

or join them

headphonesecommerce

Saltpeter answered 8/1, 2023 at 8:35 Comment(1)
There are already multiple answers suggesting this.Bead
D
0

I had a a different error linking my project.

To fix Error: Project not found:

  • Log into vercel.com
  • From the Overview page import project or click Add new... if you have existing imports
  • Import your repository
  • Run vercel link once more.
Dutiful answered 19/3 at 23:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.