benjoquilario / animehi-stream

AnimeHi is an anime streaming service that uses the consumet API. No ads and no vpn required.
https://animehi-stream.vercel.app/
GNU General Public License v3.0
39 stars 21 forks source link

Error deploying Website (on Homepage) #19

Open skgupta507 opened 3 weeks ago

skgupta507 commented 3 weeks ago

Hey @benjoquilario can u help me with issue for which i have attached the screenshot. on my deployed site it shows smething went wrong instead of the anime showing. image

https://animehi-streamx.vercel.app this is my hosted instance. can u pls help me with the solution

benjoquilario commented 3 weeks ago

did you fork the latest commit?

I changed my database, I'm using postgresql you can create one in neon.tech, also I update the next-auth im using the v5 change the environment variables with AUTH_SECRET instead

benjoquilario commented 3 weeks ago

make sure you add those environment variables in your deployment settings

skgupta507 commented 3 weeks ago

I did that but it still shows the error But I have a doubt The next api url and anime api url Should I use the same api link for both of them.

benjoquilario commented 3 weeks ago

yeah it's the same url

Gupta507 commented 3 weeks ago

yeah it's the same url

after re-entering all the env variables the issue still is there.

is there anything else i shuld solve or change

flawsom commented 3 weeks ago

just make the following changes in the environment variables part

NEXT_PUBLIC_APP_URL=http://localhost:3001/

to

NEXT_PUBLIC_APP_URL=http://localhost:3000/

flawsom commented 3 weeks ago

@benjoquilario Even tho i am having the correct set of environment variables and after running

npm i --legacy-peer-deps

when i go ahead for npm run dev

animehi@1.2.0 dev next dev

❌ Invalid environment variables: { AUTH_SECRET: [ 'Required' ] } file:///workspace/animehi-stream/node_modules/@t3-oss/env-core/dist/index.js:29 throw new Error("Invalid environment variables"); ^

Error: Invalid environment variables at onValidationError (file:///workspace/animehi-stream/node_modules/@t3-oss/env-core/dist/index.js:29:15) at createEnv (file:///workspace/animehi-stream/node_modules/@t3-oss/env-core/dist/index.js:35:16) at createEnv (file:///workspace/animehi-stream/node_modules/@t3-oss/env-nextjs/dist/index.js:12:12) at file:///workspace/animehi-stream/src/env.mjs:4:20 at ModuleJob.run (node:internal/modules/esm/module_job:222:25) at async ModuleLoader.import (node:internal/modules/esm/loader:316:24) at async loadConfig (/workspace/animehi-stream/node_modules/next/dist/server/config.js:698:36) at async Module.nextDev (/workspace/animehi-stream/node_modules/next/dist/cli/next-dev.js:175:14)

Node.js v20.13.1

flawsom commented 3 weeks ago

What am i doing wrong ?

skgupta507 commented 3 weeks ago

hey @benjoquilario thanks for the help i found out the issue. the error was occuring due to the database tables not being created. i had forgot run the command to create the database tables. pnpm prisma db push

skgupta507 commented 3 weeks ago

can u maybe add this to the readme of the projects so that new user do this during their deployment.

InstaTechHD commented 3 weeks ago

I was having the same issue where nothing is showing on the website after deploying, created a database from neon.tech and now its not deploying anymore

skgupta507 commented 3 weeks ago

@benjoquilario Even tho i am having the correct set of environment variables and after running

npm i --legacy-peer-deps

when i go ahead for npm run dev

animehi@1.2.0 dev next dev

❌ Invalid environment variables: { AUTH_SECRET: [ 'Required' ] } file:///workspace/animehi-stream/node_modules/@t3-oss/env-core/dist/index.js:29 throw new Error("Invalid environment variables"); ^

Error: Invalid environment variables at onValidationError (file:///workspace/animehi-stream/node_modules/@t3-oss/env-core/dist/index.js:29:15) at createEnv (file:///workspace/animehi-stream/node_modules/@t3-oss/env-core/dist/index.js:35:16) at createEnv (file:///workspace/animehi-stream/node_modules/@t3-oss/env-nextjs/dist/index.js:12:12) at file:///workspace/animehi-stream/src/env.mjs:4:20 at ModuleJob.run (node:internal/modules/esm/module_job:222:25) at async ModuleLoader.import (node:internal/modules/esm/loader:316:24) at async loadConfig (/workspace/animehi-stream/node_modules/next/dist/server/config.js:698:36) at async Module.nextDev (/workspace/animehi-stream/node_modules/next/dist/cli/next-dev.js:175:14)

Node.js v20.13.1

@flawsom use this 0da6c93385b73b6901d84f32148b6dd3 as the auth_secret variable Then it should work or u can generate a new one from here https://generate-secret.vercel.app.

Gupta507 commented 3 weeks ago

I was having the same issue where nothing is showing on the website after deploying, created a database from neon.tech and now its not deploying anymore

Hey @InstaTechHD after creating the database u need to run the command pnpm prisma db push in local machine. so that it creates the required tables for the database to work if not its empty (no tables in there). once u run the above command. Redeploy the site and it shuld work properly.

This Issiue occurs when the prisma schema was not able to create any tables in the database. which can be created with the pnpm prisma db push command.

try it out n let us know if it works for u or not.