Drizzle alongside Electron, Vite and Nuxt
Hey!
Recently decided to go for Drizzle on my Manga reading app I'm making with electron and nuxtjs (vue framework).
However when I compile my code through vite, nuxt-electron and vite-plugin-electron, I get this fatal error:
(other message since discord's limit..)
It ain't the first time it happened to someone: https://stackoverflow.com/questions/78614985/could-not-dynamically-require
But no relevant answer as the only one wanted us to use better-sqlite3..
If you need any other info, please ping me.
Thanks in advance,
Adam
Stack Overflow
Could not dynamically require
I write electron applications using typescript, vite and react. I also want to use sqlite (the application should run locally). I found a great ORM (Drizzle), but I have a problem with the libSQL d...
11 Replies
I'm using the libsql driver, following the guide in the Get Started section under SQLite.
Here is my nuxt configuration (which also includes vite's)
You show adding this to your nuxt config. Did you try adding it to your vite config instead?
Oh, I see you say it's the same.
yea
the vite section on nuxt's config is simply vite's defineConfig thingy
I might have found an issue, forgot there was a vite section for each electron builds too, might try adding the dynamicRequireTargets there
well now I have a different error about protocols
this repo uses prisma not drizzle but maybe the config can shed light on your issue?
https://github.com/gurvancampion/nuxt-electron-trpc-prisma/blob/master/nuxt.config.ts
GitHub
nuxt-electron-trpc-prisma/nuxt.config.ts at master · gurvancampion...
Contribute to gurvancampion/nuxt-electron-trpc-prisma development by creating an account on GitHub.
yea might try their dependencies external thingy
welp
still protocl issue
holdon
i know why my bad
Okay protocl is progress though not a build issue anymore
forgot the "file:" before in drizzle initialization
Awesome! So working now?
well doing every dependency in the rollup ,options got the error back
I fixed it by going back to my "manual" rollup options, only including libsql stuff
this one here
and now it works
well I can give an answer to the dude on stackoverflow eheh
That's great. Good luck with your project
thanks for your time man!