nicoalbanese / kirimase

Build full-stack Next.js apps, incredibly fast
https://kirimase.dev
MIT License
2.39k stars 107 forks source link

Issue with Supabase Setup? #117

Closed williambarberjr closed 5 months ago

williambarberjr commented 5 months ago

Config File { "hasSrc": true, "packages": [ "shadcn-ui", "drizzle", "lucia", "trpc", "resend", "stripe" ], "preferredPackageManager": "bun", "t3": false, "alias": "@", "rootPath": "src/", "componentLib": "shadcn-ui", "driver": "pg", "provider": "supabase", "orm": "drizzle", "auth": "lucia" }

Describe the bug I'm not a web dev don't think kirimase is setting up supabase connection correctly and as a result lucia can't add users. When I attempt to login the error I get is: Attempted import error: 'pool' is not exported from '@/lib/db/index' (imported as 'pool').

Import trace for requested module: ./src/lib/auth/lucia.ts ./src/lib/auth/utils.ts ./src/app/page.tsx ⚠ ./src/lib/auth/lucia.ts Attempted import error: 'pool' is not exported from '@/lib/db/index' (imported as 'pool').

Import trace for requested module: ./src/lib/auth/lucia.ts ./src/lib/auth/utils.ts ./src/app/page.tsx ⚠ ./src/lib/auth/lucia.ts Attempted import error: 'pool' is not exported from '@/lib/db/index' (imported as 'pool').

Import trace for requested module: ./src/lib/auth/lucia.ts ./src/lib/auth/utils.ts ./src/app/page.tsx ⚠ ./src/lib/auth/lucia.ts Attempted import error: 'pool' is not exported from '@/lib/db/index' (imported as 'pool').

Import trace for requested module: ./src/lib/auth/lucia.ts ./src/lib/auth/utils.ts ./src/app/page.tsx ⚠ ./src/lib/auth/lucia.ts Attempted import error: 'pool' is not exported from '@/lib/db/index' (imported as 'pool').

Import trace for requested module: ./src/lib/auth/lucia.ts ./src/app/sign-up/page.tsx TypeError: Cannot read properties of undefined (reading 'connect') at transaction (webpack-internal:///(rsc)/./node_modules/@lucia-auth/adapter-postgresql/dist/drivers/pg.js:11:39) at Object.setUser (webpack-internal:///(rsc)/./node_modules/@lucia-auth/adapter-postgresql/dist/drivers/pg.js:41:27) at Auth.createUser (webpack-internal:///(rsc)/./node_modules/lucia/dist/auth/index.js:157:32) at async POST (webpack-internal:///(rsc)/./src/app/api/sign-up/route.ts:34:22) at async /home/myusername/projects-wsl/kirimase-test/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:63251 ^C

To Reproduce Steps to reproduce the behavior: bun create next-app@latest myproj cd myproj kirimase init added secrets to .env file supabase init supabase migrations new init bun db:generate manually copy over the .sql file from src/lib/db/migrations into the empty .sql file already in supabase/migations supabase start bun run dev *attempt to login, UI shows: Error! An unknown error occurred

Expected behavior Expected to see the main confirming the info of the logged in user.

Desktop (please complete the following information):

williambarberjr commented 5 months ago

Ok, looked into this a little further and this was, as they say "a skill issue" :)

Everything works correctly if you get the order of the supabase cli commands correct.

bun create next-app@latest myproj cd myproj kirimase init (including selecting drizzle, postgres and supabase) supabase init supabase start *added secrets to .env file including the database url copied from the supabase cli output bun db:generate bun db:migrate bun stripe:listen bun run dev

And everything works beautifully.