Open david-mears-2 opened 3 months ago
Same issue, this is so lame :P
https://github.com/prisma/nuxt-prisma/blob/main/src/module.ts#L85 Also causes optimizeDepths to be totally rewritten.
This Module assumes more things like:
In current state, would not recommend using this module. (sorry for the bash, I know people work hard on this but it just isn't production worthy for my 2cents )
Hey @Harm-Nullix, thanks for reporting the issue.
I understand your frustration and appreciate your feedback. Could you provide a reproduction so I can better investigate the problem?
Regarding the assumptions you mentioned:
Experimental Settings: [main/src/module.ts#L74](https://github.com/prisma/nuxt-prisma/blob/main/src/module.ts?rgh-link- date=2024-08-09T08%3A43%3A09Z#L74) Frontend Exposure: [main/src/module.ts#L97](https://github.com/prisma/nuxt-prisma/blob/main/src/module.ts?rgh-link- date=2024-08-09T08%3A43%3A09Z#L97)
I appreciate you pointing these out. We’re planning further improvements, but these particular assumptions may not be directly related to the current issue. Could you create a separate issue for these points? This will help me address them more effectively.
Versions
Issue
Running the dev server works fine. Running
nuxt build
(vianpm run build
) when@prisma/nuxt
is listed in the modules innuxt.config.ts
deletes other nuxt modules fromnode_modules/@nuxt
, leading to errors such as:or '@nuxt/test-utils', etc: the first module that fails to be found depends on the order in which modules are listed in nuxt.config.ts.
Before running
npm run build
, the nuxt part of my node_modules looked like this:After running
npm run build
, which errored as above, the nuxt part of my node_modules looked like this:This uninstalled or deleted a lot of nuxt modules, such that for example trying to run
npm run build
immediately afterwards led to:The other modules listed in my
nuxt.config.ts
are:Possible workaround?
My workaround is to not use
@prisma/nuxt
.I found that I could run the build step and it did not delete nuxt modules, and I could still use prisma (at least, I could perform operations from within an api endpoint, as below) if I uninstalled
@prisma/nuxt
, omitted the module from nuxt.config.ts, and used 'usage option B' instead of the composable.