Code Monkey home page Code Monkey logo

Comments (10)

vimulatus avatar vimulatus commented on July 18, 2024

This has created an issue for me:

If I use a custom output path (even after removing a ../). I get an error telling me that the module can't be found in compile time. However, intellisense is working. And when I visit the location, I can see the correct files.

If I remove the custom output path, the app gets compiled.

from prisma.

eternal-eager-beaver avatar eternal-eager-beaver commented on July 18, 2024

I faced the same issue

from prisma.

janpio avatar janpio commented on July 18, 2024

Do I understand correctly that moving your Prisma Schema from ./prisma/schema.prisma to ./prisma/schema/foo.prisma and ./prisma/schema/bar.prisma leads to the output value still being evaluated relative to ./prisma instead of ./prisma/schema?

from prisma.

xudo49 avatar xudo49 commented on July 18, 2024

Do I understand correctly that moving your Prisma Schema from ./prisma/schema.prisma to ./prisma/schema/foo.prisma and ./prisma/schema/bar.prisma leads to the output value still being evaluated relative to ./prisma instead of ./prisma/schema?

it not work too.
image
image
image

from prisma.

vimulatus avatar vimulatus commented on July 18, 2024

@janpio yes, you are right.

from prisma.

vimulatus avatar vimulatus commented on July 18, 2024

This has created an issue for me:

If I use a custom output path (even after removing a ../). I get an error telling me that the module can't be found in compile time. However, intellisense is working. And when I visit the location, I can see the correct files.

If I remove the custom output path, the app gets compiled.

Using Custom Output Path

Generator

Screenshot 2024-06-11 at 10 19 45 AM

Files inside @prisma/client

Screenshot 2024-06-11 at 10 22 13 AM

Prisma Client Service in NestJS

Screenshot 2024-06-11 at 10 25 23 AM

Error

Screenshot 2024-06-11 at 10 26 23 AM

However, if I omit the custom output path, it works fine

from prisma.

janpio avatar janpio commented on July 18, 2024

@xudo49 Please open a new discussion or issue for your problem, it does not sounds related to this one. Thank you.

from prisma.

janpio avatar janpio commented on July 18, 2024

@vimulatus Generally generating into node_modules manually and especially node_modules/@prisma/client might not be the best idea, as the behavior of this is pretty much undefined with custom output. Usually you would probably be better off choosing a defined path in your project.

That being said, that does not explain the error you are getting. Can you delete your node_modules, and then re-install them and run prisma generate to double check if it creates your generated Prisma Client in the correct place? Did you look into that master folder to make sure there is the correct stuff that should be there?

from prisma.

eternal-eager-beaver avatar eternal-eager-beaver commented on July 18, 2024

@janpio I've checked it before and yes, it's generate Prisma Client in the correct place.
Screenshot 2024-06-12 at 12 54 39

from prisma.

janpio avatar janpio commented on July 18, 2024

It seems that the path finding for output in Prisma Schema is currently not as expected with prismaSchemaFolder. It still seems to use ./prisma as the source, even when you moved your ./prisma/schema.prisma to ./prisma/schema/*.prisma. It is clearer that this is invalid when you actually have a custom schema folder path like --schema foo/bar and all your files are in foo/bar/*.prisma - then the output seems to currently be relative to foo.

We might need to revisit this, and either use the schema folder as the folder to be relative to, or even more correct the file (as in theory the file with the output definition could also be in a subfolder of the schema folder).

from prisma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.