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

QwikJS Example? #4545

Open
y471n opened this issue Mar 2, 2023 · 1 comment
Open

QwikJS Example? #4545

y471n opened this issue Mar 2, 2023 · 1 comment

Comments

@y471n
Copy link

y471n commented Mar 2, 2023

Hi, I was wondering if you guys can create a Qwik example as well for best practices such as you've for NextJS:


let prisma: PrismaClient

if (process.env.NODE_ENV === 'production') {
    prisma = new PrismaClient()
} else {
    if (!global || !global.prisma) {
        global.prisma = new PrismaClient()
    }
    prisma = global.prisma
}
export default prisma

Above throws errors and issues in a QwikJS Project.

@y471n y471n changed the title Qwik Example? QwikJS Example? Mar 2, 2023
@notcod
Copy link

notcod commented Dec 19, 2023

What about this?

  • src/entry.ssr.tsx

... export const prisma: PrismaClient = new PrismaClient(); ...

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

No branches or pull requests

2 participants