prisma-factory
prisma-factory copied to clipboard
ENOENT when trying to use generated functions with Jest
Hey there,
Thanks for the work on this package - looks great! 😁
Any chance you'd know why Jest is struggling to find the generated index.js
? I get the following error:
ENOENT: no such file or directory, open '/{path to code}/node_modules/prisma-factory/dist/generated.js'
Example of my code:
import { createUserFactory } from 'prisma-factory/generated';
export const UserFactory = createUserFactory({
email: '[email protected]',
password: '123',
verified: true,
});
I've checked that the generated code is there inside node_modules
– not sure if this is an issue with my jest/typescript config or a package issue?
Thanks again
Have you resolved it ?
Just a bump up to share that it's still going on. Happening on Turborepo monorepo.
Cannot find module '/Users/lea/dev/app/node_modules/prisma-factory/dist/generated/index.js
Basically in the node_modules
the dist/generated/index.js
can not be seen:
Any resolution on this ?
I'm experiencing the same issue
I tried adding a dummy file there but it did not work out for me.
node_modules/prisma-factory/dist/generated.js
module.exports = {};
seems like some build artifact is missing? Has anyone been able to workaround this?
Hi all, I've solved the problem here #25
Is there any workaround for this? I'd really love to use this package!
Is there any workaround for this? I'd really love to use this package!
Unfortunately there aren't any workaround.... I've solved the problem with this pr #25, but it seems it is not merged yet...
I actually found a working solution for me. Just move the generated output to a local directory.
generator factories {
provider = "prisma-factory"
output = "./generated"
}
I still have a problem because the path to the client is not escaped for Windws OS but that's a different issue