question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generator: `output` is relative to `./prisma`

See original GitHub issue

If you have a generator in your schema.prisma like this:

generator testutils {
  provider = "./node_modules/prisma-test-utils/dist/generator.js"
  output = "./node_modules/@generated/prisma-test-utils"
}

The output is actually generated in ./prisma/node_modules/@generated/prisma-test-utils:

✔ Generated Prisma Test Utils to .\prisma\node_modules\@generated\prisma-test-utils in 3.95s

That was unexpected to me.

Changing output to use ../node_modules... fixes the problem.

(Could potentially also be the fault of the generator I am trying to use.)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pantharshit00commented, Sep 2, 2020

This still happens in 2.6.0-dev.61. The output still uses the prisma directory as a root.

image

0reactions
pantharshit00commented, May 5, 2021

Ok, it is indeed relative to schema.prisma location. I just tried that out.

We don’t document whether it is relative to schema or not: https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#fields-1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generators (Reference) - Prisma
A generator determines which assets are created when you run the prisma generate command. The main property provider defines which Prisma Client (language ......
Read more >
Prisma generators output abnormally - A bug, or a possible ...
Issue: When executing the npx prisma generate command, there is a possibility of an error with the following log or a similar error...
Read more >
Create Prisma Generator - DEV Community ‍ ‍
prisma tells the generator where to output the generated files with a path relative to the directory where schema.prisma is located, try to ......
Read more >
DBML generator for Prisma - notiz.dev
Introducing Prisma DBML Generator automatically generating a DBML schema based ... @id bio String? user User @relation(fields: [userId], ...
Read more >
Prisma Relations and Redwood's Generators
You can generate the SDLs for all the models in the relation, ignoring the errors. This way the last model in the relation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found