haydenbleasel / next-forge

Production-grade Turborepo template for Next.js apps.
https://www.next-forge.com/
MIT License
3.78k stars 294 forks source link

Error when starting for the first time #246

Open PierrickLozach opened 3 days ago

PierrickLozach commented 3 days ago

I get this error when I run pnpm dev and go to http://localhost:3000:

Import trace for requested module:
app:dev: ../../node_modules/.pnpm/picocolors@1.0.1/node_modules/picocolors/picocolors.js
app:dev: ../../node_modules/.pnpm/tailwindcss@3.4.14_ts-node@10.9.2_@swc+core@1.3.101_@swc+helpers@0.5.13__@types+node@22.9.0_typescript@5.6.3_/node_modules/tailwindcss/lib/featureFlags.js
app:dev: ../../node_modules/.pnpm/tailwindcss@3.4.14_ts-node@10.9.2_@swc+core@1.3.101_@swc+helpers@0.5.13__@types+node@22.9.0_typescript@5.6.3_/node_modules/tailwindcss/lib/util/getAllConfigs.js
app:dev: ../../node_modules/.pnpm/tailwindcss@3.4.14_ts-node@10.9.2_@swc+core@1.3.101_@swc+helpers@0.5.13__@types+node@22.9.0_typescript@5.6.3_/node_modules/tailwindcss/lib/public/resolve-config.js
app:dev: ../../node_modules/.pnpm/tailwindcss@3.4.14_ts-node@10.9.2_@swc+core@1.3.101_@swc+helpers@0.5.13__@types+node@22.9.0_typescript@5.6.3_/node_modules/tailwindcss/resolveConfig.js
app:dev: ../../packages/tailwind-config/index.ts
app:dev: ../../packages/auth/provider.tsx
app:dev:  ⨯ next/dist/src/lib/is-error.ts (60:10) @ getProperError
app:dev:  ⨯ Error: [object Object]
app:dev:     at AsyncLocalStorage.run (node:async_hooks:346:14)
app:dev: digest: "4014698488"
app:dev:   58 |   }
app:dev:   59 |
app:dev: > 60 |   return new Error(isPlainObject(err) ? safeStringify(err) : err + '')
app:dev:      |          ^
app:dev:   61 | }
app:dev:   62 |
app:dev:  GET / 500 in 82466ms

next-forge version I am using version 2.3.10

To Reproduce Follow the setup instructions. Add environment variables

Screenshots

image

image

Desktop (please complete the following information):

I believe it might be due to one of the environment variables (I have created accounts on each provider) but I can't find which one is causing the error?

Thanks!

haydenbleasel commented 3 days ago

@PierrickLozach I believe I saw this error myself stemming from Prisma when the DATABASE_URL was invalid (or at least, couldn't access the database). Can you double check this field for me in apps/app/.env.local?

bogdansalau commented 3 days ago

Also experiencing this. DATABASE_URL is set, I can also open prisma studio and add new rows in the DB.

eduardodusik commented 3 days ago

Are you using neon as a database? By default the project is using neon.

By default, next-forge uses [Neon](https://neon.tech/) as its database provider and [Prisma](https://prisma.io/) as its ORM. However, you can easily switch to other providers if you’d prefer,

I was getting this error, but because I wasn't using neon but a postgres database from railway.

To solve this I changed the way the connection is made.

haydenbleasel commented 2 days ago

Great point. @PierrickLozach what database provider are you using?

bogdansalau commented 15 hours ago

This fixed my issue! Thanks!