qwikifiers / qwik-nx

Nx plugin for Qwik
130 stars 23 forks source link

feat: prisma integration #161

Open DennisVanIngen opened 1 year ago

DennisVanIngen commented 1 year ago

Current Behavior

when creating a qwik nx project and adding prisma with npx qwik add. Pages that use the prisma client crash.

Expected Behavior

Should support the prisma integration

GitHub Repo

No response

Steps to Reproduce

  1. create qwik nx project
  2. add prisma using npx qwik add
  3. go to /users page

Nx Report

nx : The term 'nx' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was 
included, verify that the path is correct and try again.
At line:1 char:1
+ nx report
+ ~~
    + CategoryInfo          : ObjectNotFound: (nx:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Failure Logs

Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.
In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues
    at new PrismaClient (C:\projects\com-toolsensei\node_modules\.prisma\client\index.js:3:11)
    at Function.Lu (file:///C:/projects/com-toolsensei/dist/apps/dashboard/server/entry.preview.mjs:306:734)
    at Function.W (file:///C:/projects/com-toolsensei/dist/apps/dashboard/server/entry.preview.mjs:27:5038)
    at file:///C:/projects/com-toolsensei/dist/apps/dashboard/server/entry.preview.mjs:31:2261
    at R (file:///C:/projects/com-toolsensei/dist/apps/dashboard/server/entry.preview.mjs:25:1493)
    at file:///C:/projects/com-toolsensei/dist/apps/dashboard/server/entry.preview.mjs:31:2167
    at Function.p [as __qrl] (file:///C:/projects/com-toolsensei/dist/apps/dashboard/server/entry.preview.mjs:31:2380)
    at file:///C:/projects/com-toolsensei/dist/apps/dashboard/server/entry.preview.mjs:16:716
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Promise.all (index 0)

Additional Information

No response

dmitry-stepanenko commented 1 year ago

Hey @DennisVanIngen, we're not supporting prisma integration as of now. And unfortunately you won't be able to use qwik cli to add it, because the structure of Nx and standalone repos are incompatible. The best what I can suggest as of now is creating a dummy qwik project, run an integration there and copy changes in the other project you need. Don't forget to adjust paths accordingly. If you struggle with anything while doing it, let me know, I'll try to help.

Meanwhile I'm going to keep this ticket to track actual prisma integration

DennisVanIngen commented 1 year ago

@dmitry-stepanenko I forgot about this issue. I managed to get prisma working in my project by adding a prisma folder in the root of the project. But now converting to drizzle :)