Got error while deploying my NextJS project in Vercel.
Answered
Sumon Chandra posted this in #help-forum
![Avatar](https://cdn.discordapp.com/avatars/882006566704922694/2a6e32c5bb03ff9360633e3bc19bb4fa.webp?size=256)
Sumon ChandraOP
My project repo : - https://github.com/sumon-chandra/ecoobazar
When I deploy my project in vercel it gives me this error. It says -------
Error: > Couldn't find any pages or app directory. Please create one under the project root
This error shows when hits this ( "next build prisma generate" ) command.
#vercel-help
When I deploy my project in vercel it gives me this error. It says -------
Error: > Couldn't find any pages or app directory. Please create one under the project root
This error shows when hits this ( "next build prisma generate" ) command.
#vercel-help
![Image](https://cdn.discordapp.com/attachments/1178936034914996285/1178936035191836693/image.png?ex=6577f4be&is=65657fbe&hm=56f36815de43b95f5b9138a88990f83f57c15791183d879784b281023dfda98e&)
![Image](https://cdn.discordapp.com/attachments/1178936034914996285/1178936035456073738/image.png?ex=6577f4be&is=65657fbe&hm=0109fae1bc9d2e43c65a68c6f5ec27bf78425cd0ca4889258056c710034da02d&)
35 Replies
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
Toyger
probably you are in a wrong folder in shell,
at least in error it shows
but in vscode project folder name is
at least in error it shows
/vercel/path0
but in vscode project folder name is
ecoobazar
![Avatar](https://cdn.discordapp.com/avatars/882006566704922694/2a6e32c5bb03ff9360633e3bc19bb4fa.webp?size=256)
Sumon ChandraOP
@Toyger What can I do to resolve this issue?
Do you have any opinions on that?
Do you have any opinions on that?
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
Toyger
oops, I wrongly understood question.
did you use firebase, I see such bugs happened with some earlier versions if firebase was installed.
did you use firebase, I see such bugs happened with some earlier versions if firebase was installed.
![Avatar](https://cdn.discordapp.com/avatars/882006566704922694/2a6e32c5bb03ff9360633e3bc19bb4fa.webp?size=256)
Sumon ChandraOP
No, I didn't use Firebase. I used NextAuth and Prisma
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
Toyger
which version of nextjs are you using? are updated it?
I see console detected v14.0.1 but in v14
but in your code
I see console detected v14.0.1 but in v14
app
should be in rootbut in your code
src
in root and app
inside src
![Avatar](https://cdn.discordapp.com/avatars/882006566704922694/2a6e32c5bb03ff9360633e3bc19bb4fa.webp?size=256)
Sumon ChandraOP
![Image](https://cdn.discordapp.com/attachments/1178936034914996285/1178981297289441280/Screenshot_2023-11-28-14-50-31-23_320a9a695de7cdce83ed5281148d6f19.jpg?ex=65781ee5&is=6565a9e5&hm=be1325230ca0cf012c7ffd7f4201b17183ebaf6d5cd9c5c63d996f770588d417&)
It’s 14.0.1
Do I have to remove src folder and set the app folder in root?
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
Toyger
probably, but it should be like that by default, so I am not sure why your in src, in older versions was src, not sure when they changed it.
![Avatar](https://cdn.discordapp.com/avatars/882006566704922694/2a6e32c5bb03ff9360633e3bc19bb4fa.webp?size=256)
Sumon ChandraOP
Thanks @Toyger, I'll change the app folder in root, and i'll inform you that will resolve or not.
![Avatar](https://cdn.discordapp.com/avatars/289522409088876546/9422498062d396ce258b03083453c8c4.webp?size=256)
Z4NR34L
src directory still works, could you @Sumon Chandra share us your directory tree inside project so we can verify it?
you shared repository, mb I will come back in a second 🙂
![Avatar](https://cdn.discordapp.com/avatars/289522409088876546/9422498062d396ce258b03083453c8c4.webp?size=256)
Z4NR34L
Most important things first - remove env file from your repository, you are sharing your mongodb secrets currently 🙂
remember to rewrite repository history after removal
![Avatar](https://cdn.discordapp.com/avatars/882006566704922694/2a6e32c5bb03ff9360633e3bc19bb4fa.webp?size=256)
Sumon ChandraOP
Oops!!!!
Yeah, i'll fix that
@Z4NR34L what does it mean!!!
![Avatar](https://cdn.discordapp.com/avatars/289522409088876546/9422498062d396ce258b03083453c8c4.webp?size=256)
Z4NR34L
I'm currently testing the deployment of that repository - please give me a few more secconds 😄
![Avatar](https://cdn.discordapp.com/avatars/882006566704922694/2a6e32c5bb03ff9360633e3bc19bb4fa.webp?size=256)
Sumon ChandraOP
Certainly ðŸ‘
Answer
![Avatar](https://cdn.discordapp.com/avatars/289522409088876546/9422498062d396ce258b03083453c8c4.webp?size=256)
Z4NR34L
I had just removed api/auth route to get rid of issues with nextauth types as you didn't made that work so far as I can see and the project just builded and deployed 😄
oh, and I had fixed schema.prisma as it was generating client files in wrong place
I'll make an PR in a while
just fix nextauth, deploy with default build settings and would be running perfectly 😉
you can even deploy this project from 0 to be sure that you are using default vercel configuration
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository
here you will find all you need when removing sensitive data from repository 😄
here you will find all you need when removing sensitive data from repository 😄
If you consider that case as closed You can mark a message as the answer for your post with
Right click -> Apps -> Mark Solution
![Avatar](https://cdn.discordapp.com/avatars/882006566704922694/2a6e32c5bb03ff9360633e3bc19bb4fa.webp?size=256)
Sumon ChandraOP
@Z4NR34L But still it didn't work for me. 😢
![Image](https://cdn.discordapp.com/attachments/1178936034914996285/1179086972652879932/image.png?ex=65788150&is=65660c50&hm=9d0a3ca928ab27de07a6bf9b5670eb8bd4fb83e09605b0088ecadb8cd775c8a3&)
I'm trying to deploy my project but it didn't work.
![Avatar](https://cdn.discordapp.com/avatars/289522409088876546/9422498062d396ce258b03083453c8c4.webp?size=256)
Z4NR34L
again - deploy this project from scratch, delete it and import repository one again with my fixes
and change nothing for start
it was working just like that
![Avatar](https://cdn.discordapp.com/avatars/882006566704922694/2a6e32c5bb03ff9360633e3bc19bb4fa.webp?size=256)
Sumon ChandraOP
Finally!!! 😃
![Avatar](https://cdn.discordapp.com/avatars/882006566704922694/2a6e32c5bb03ff9360633e3bc19bb4fa.webp?size=256)
Sumon ChandraOP
After a lot of straggling I deployed my project. I've removed project from vercel and then again I add my project but I got er error 😒. Then I do google search for this particular problem and I found that. That was
But finally I've successfully deployed my project in vercel. 😅
@Z4NR34L Thanks man !! you are genius ! â¤ï¸
authOptions
I moved the authOptions
to lib directory and again re-upload the project in vercel. Again I got er error and that was Prisma
setup error ðŸ˜. I've find this solution in stack overflow
and I update the my prismadb
file and re-upload the project in vercel. 🫥But finally I've successfully deployed my project in vercel. 😅
@Z4NR34L Thanks man !! you are genius ! â¤ï¸
![Avatar](https://cdn.discordapp.com/avatars/289522409088876546/9422498062d396ce258b03083453c8c4.webp?size=256)
Z4NR34L
Happy that I was able to help!