#PrismaClientInitializationError

62 messages · Page 1 of 1 (latest)

dusky prism
#

Hey can anybody please help me out with this, i've tried rechecking the .env file, restarted servers, "stack overflow"d for hours...please do kindly help me out here.

bright sandalBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

craggy wyvern
#

Hi @dusky prism 👋

What does your connection string look like for your environment variable DATABASE_URL?

#

I can see that your provider is sqlite. Your connection string should look like

"file:../dev.db"
dusky prism
#

yes it does

#

probably shouldn't have uploaded the .env file lol but i really need this fixed asap

#

@craggy wyvern

merry crane
#

You mad bro. Remove this

dusky prism
#

i think this should do!

merry crane
#

You using an sql lite db?

#

First go setup a proper db. Postgres or SQl. Then Put the details in. Then go from there. No one really using sqlite in production.

#

I would not spend hours trying to fix that

dusky prism
#

i just need this to work! TwT

#

not for production tbf

merry crane
#

What framework are you using? nextjs?

#

Just came across this, might be relevant to your use case

dusky prism
dusky prism
#

thanks a ton man :)

merry crane
#

Im currently also trying to get it working on nextjs with app directory

#

Not fun at all. Not sure why but they are still not edge compatible

dusky prism
#

well one needs to add this to their package.json

#

also take care of typesafety

#

fml

dusky prism
merry crane
#

Yeah it's always been quite clunky. I was willing to deal with that. But this is the final straw for me

#

I will report if I find a solution

dusky prism
#

i tried drizzle lmao, faced a few issues there too smh

#

yeah i got rid of sqlite and going for postgres

#

any clue about this error mate?

merry crane
#

Thats to do with the encoding in your strings

#

Check you might have some stuff where you are writing words or text on your page

#

You need to use escape characters instead of apostrophes etc

#

You can usually also get around it by using certain brackets and things

#

There are various strategies to avoid it. Just give it a google. Usually happens when you typing text directly into the components like that

#

You can create seperate config files for your website then import those variables. It works well and is a neat way to work

dusky prism
#

yeah fixed it but more new errors smh

#

post implicitly has any type here, ts and it's typesafety TwT

#

i'll kms

dusky prism
merry crane
#

Try chatgpt or claude to show you how to do all the type assertions.

#

You can change the rules as well. But best to just fix it.

#

post: {id: string, title:string}

dusky prism
#

yeah doing that manually rn

#

time consuming

merry crane
#

That's typescript for you. But very much worth it

dusky prism
#

what even are these 😢

#

is prisma not compatible with pnpm?

#

god knows why i decided trying out pnpm for this project smh

merry crane
#

Pnpm is good i use it for everything

#

what does the rest of the error message say.

#

It normally is not this difficult

#

What database are you setting up?

#

These issues are the same as what I am dealing with now. Regarding prisma and issue with nextjs

dusky prism
#

basically im unable to create the db

#

db push is just not working

#

error message when i tried npx prisma db push

merry crane
#

Send me a dm with the string

merry crane
#

Dude try prisma accelerate free plan

#

You are going to pull your hair out trying to configure otherwise. But you can also check those docs i sent you.