Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuxt/Prisma conflict with Nuxt/UI #64

Closed
DT-Zilo opened this issue Nov 30, 2024 · 18 comments · Fixed by #68
Closed

Nuxt/Prisma conflict with Nuxt/UI #64

DT-Zilo opened this issue Nov 30, 2024 · 18 comments · Fixed by #68
Labels

Comments

@DT-Zilo
Copy link

DT-Zilo commented Nov 30, 2024

Environment

  • OS : Windows 11
  • Node : 20.14.0
  • Nuxt: lastest
  • Nuxt prisma : lastest

Version

2.19.1

Reproduction

init lastest nuxt 3
add nuxt prisma module
add nuxt ui module

` ERROR RollupError: node_modules/@prisma/nuxt/dist/runtime/server/utils/prisma.d.ts (2:8): Expected ';', '}' or (Note that you need plugins to import files that are not JavaScript) nitro 21:27:12

1: import { PrismaClient } from "@prisma/client";
2: declare const prismaClientSingleton: () => PrismaClient<import(".prisma/client").Prisma.PrismaClientOptions, never, i...
^
3: declare const prisma: PrismaClient<import(".prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client...
4: export type CustomPrismaClient = ReturnType;`

Description

when remove '@nuxt/ui' from modules: [''] in nuxt.config.ts it's work can use npm run dev
but if add '@nuxt/ui' it''s error

` ERROR RollupError: node_modules/@prisma/nuxt/dist/runtime/server/utils/prisma.d.ts (2:8): Expected ';', '}' or (Note that you need plugins to import files that are not JavaScript) nitro 21:27:12

1: import { PrismaClient } from "@prisma/client";
2: declare const prismaClientSingleton: () => PrismaClient<import(".prisma/client").Prisma.PrismaClientOptions, never, i...
^
3: declare const prisma: PrismaClient<import(".prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client...
4: export type CustomPrismaClient = ReturnType;`

@gsxdsm
Copy link

gsxdsm commented Dec 1, 2024

Same issue here

@gsxdsm
Copy link

gsxdsm commented Dec 1, 2024

This has become a huge issue - its not just a conflict with Nuxt/UI, but several other packages like nuxt-concierge.

This really needs to be fixed! It seems like deleting the .nuxt directory and then doing a build works the first time, but if there is a .nuxt directory then it always fails with this error.

@gsxdsm
Copy link

gsxdsm commented Dec 1, 2024

Even an empy .nuxt directory doesn't resolve it, the entire .nuxt directory has to be removed.

@gsxdsm
Copy link

gsxdsm commented Dec 1, 2024

Related to #12

Deleting node_modules/@prisma/nuxt/dist/runtime/server/utils/prisma.d.ts temporarily solves it, but it's not a long term solution. @ankur-arch - can this be prioritized? It is a huge annoyance.

@gsxdsm
Copy link

gsxdsm commented Dec 2, 2024

Of course, deleting prisma.d.ts means you lose types and IDE autocomplete... :-(

@LarsDD-gh
Copy link

Got the same issue.

Any idea, how to work-arround it? Maybe by configuring rollup to skip the problematic file?

@ankur-arch
Copy link
Contributor

@LarsDD-gh

Any idea, how to work-arround it? Maybe by configuring rollup to skip the problematic file?

Could you folks see if this version works for you? 0.0.31-fix-rollup-error. As, this seems like a regression to me.

Thanks, @gsxdsm! It’s been two weeks of hectic planning, so I’ve been incredibly busy. I really appreciate all your insights and completely understand the frustration.

I’ll make room and prioritize this next week!

@LarsDD-gh
Copy link

@LarsDD-gh

Any idea, how to work-arround it? Maybe by configuring rollup to skip the problematic file?

Could you folks see if this version works for you? 0.0.31-fix-rollup-error. As, this seems like a regression to me.

Thanks, @gsxdsm! It’s been two weeks of hectic planning, so I’ve been incredibly busy. I really appreciate all your insights and completely understand the frustration.

I’ll make room and prioritize this next week!

@ankur-arch the fix works for me. I change dependencies in package.json from
"@prisma/nuxt": "0.1.0",
to
"@prisma/nuxt": "0.0.31-fix-rollup-error",
and npm run dev works as expected.

Thanks a lot for the VERRRY quick response/help!

Lars

@DesertCookie
Copy link

Could you folks see if this version works for you? 0.0.31-fix-rollup-error.

Works for me after downgrading from "@prisma/nuxt": "0.1.2". Thanks!

@gsxdsm
Copy link

gsxdsm commented Dec 9, 2024

Thanks so much @ankur-arch ! Testing today and will report back but looks promising.

@ankur-arch
Copy link
Contributor

Hi @gsxdsm, let me know if the Rollup error is being addressed. I’ll push an update once it’s resolved—it definitely seems like a regression.

@gsxdsm
Copy link

gsxdsm commented Dec 10, 2024

Yes seems to be resolved thank you!

@andreakru
Copy link

does this still work only with 0.0.31-fix-rollup-error ?

@ThomasBerne
Copy link

Same issue here with @sidebase/nuxt-auth

@ankur-arch
Copy link
Contributor

ankur-arch commented Dec 12, 2024

Hi @andreakru and @ThomasBerne , I'm trying to identify the regression and have a pre-release version @prisma/nuxt@0.0.0-experimental-72b9dd7 from this PR that I haven't been able to test completely.

Can you see if the provided version works, then I'll merge it in.

@andreakru
Copy link

Hi @andreakru and @ThomasBerne , I'm trying to identify the regression and have a pre-release version @prisma/nuxt@0.0.0-experimental-72b9dd7 from this PR that I haven't been able to test completely.

Can you see if the provided version works, then I'll merge it in.

It seems to works fine for me.

ankur-arch added a commit that referenced this issue Dec 13, 2024
fix(#64): avoid importing server files
Copy link

🎉 This issue has been resolved in version 0.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ankur-arch
Copy link
Contributor

Thanks for your patience everyone, I've merged it in 🥳 , and this issue should be fixed in the latest version v0.1.3!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants