Delete annoying warning in production
This warning pop-up in my log all the time :
prisma:warn In production, we recommend using
prisma generate --no-engine (See:
prisma generate --help)
I'm using the "normal" client and also the "edge" client, depending on my endpoint, so I can't use the --no-engine option.
Is there a way to make this warning finally go away ?
Thanks !4 Replies
You selected the bot's instantaneous insights. Let me compile your answer right away!
Based on the knowledge sources provided, I can offer a solution to your issue with the annoying warning message in production. There are a couple of ways to address this:
1. Use the
--no-hints
flag:
As of a recent update, Prisma has introduced a --no-hints
flag that can be used with the prisma generate
command to suppress these types of informational messages. You can use it like this:
This option is mentioned in the Github Issue #22513.
2. Use the PRISMA_DISABLE_WARNINGS
environment variable:
If you prefer an environment variable approach, you can set PRISMA_DISABLE_WARNINGS
to a truthy value. This will disable all CLI warnings generated by logger.warn
, including the one you're seeing.
This is documented in the Prisma docs on environment variables.
You can choose whichever method is more convenient for your setup. The --no-hints
flag is more specific to suppressing informational messages, while PRISMA_DISABLE_WARNINGS
will suppress all warnings, which might be broader than what you need.
Remember that while these methods will suppress the warning, it's always a good idea to understand why the warning is there and ensure that your production setup is optimized according to Prisma's recommendations when possible.
š¤ Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly.
In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.Neither of these solutions work sadly (I tested them)
Can you try running something like this:
Yeah generate does not give me any issues, it's the client
My script for generate which is run before starting my app :
Any ideas for this ? š