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

require syntax #19

Open
ilanbro opened this issue Oct 28, 2024 · 0 comments
Open

require syntax #19

ilanbro opened this issue Oct 28, 2024 · 0 comments

Comments

@ilanbro
Copy link

ilanbro commented Oct 28, 2024

Hi,

I've managed to get the extension working successfully in JS using the sample code shared in .md.
I have an issue running the same example using the 'require' syntax.

const { PrismaClient } = require('@prisma/client'); const prismaRandom = require('prisma-extension-random'); // const prisma = new PrismaClient(); const prisma = new PrismaClient().$extends(prismaRandom);

The errors that I'm getting are:
TypeError: prisma.newQuote.findRandom is not a function
TypeError: prisma.newQuote.findManyRandom is not a function

I've tried multiple other forms to workaround it but assume this is an issue upstream / in the module itself and it exports the prismaRandom interface?

Thanks!

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

1 participant