Help! facing this enum export issue.
I sometimes face this issue, i upgraded the Prisma to V7, it was working perfect, Today i tried to regenerate the prisma client and ended up having this issue.

2 Replies
Skipping coffee for instant knowledge! Let's brew that AI answer now.
It looks like you're encountering issues with enum exports after regenerating the Prisma Client in v7. This is a known pain point, especially with recent changes to enum handling and the new generator.
Common causes and solutions:
1. Mapped Enums Breaking Change in v7:
Prisma 7 introduced stricter handling for mapped enums, requiring you to use the enum key names (e.g.,
Mapped enums breaking change will block migration to 7.0
Fix: Mapped Enum Handling in Prisma Create Operations 2. Enum Not Exported If Unused:
If your enum is defined in the schema but not used in any model, Prisma will not generate TypeScript definitions for it. You must reference the enum in at least one model field to ensure it gets exported.
Missing generated Enum in typescript definition when Enum isn't used in Prisma table 3. Export/Import Issues in ESM/CJS:
There have been issues with how enums are exported in ESM builds, especially with the new
bun run build error with prisma ^6.7.0
TypeError: __banner_node_url when using enums on the client-side 4. Potential Workaround:
If you need to import enums separately, consider re-exporting them from a custom file or using the workaround described in Separate enums and constants from the rest of the generated client. If these steps don't resolve your issue, please provide the specific error message and your generator config for more targeted help. 🤔 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.
Prisma 7 introduced stricter handling for mapped enums, requiring you to use the enum key names (e.g.,
PENDING) instead of the mapped database values (e.g., "pending"). If you were previously using the mapped values, this will now cause validation errors. The Prisma team has released a fix to ensure the client generates and expects the correct enum key names, but you must ensure you're on the latest patch of v7 for this to work as expected. If you’re still seeing issues, check for updates or related open issues for your specific case.Mapped enums breaking change will block migration to 7.0
Fix: Mapped Enum Handling in Prisma Create Operations 2. Enum Not Exported If Unused:
If your enum is defined in the schema but not used in any model, Prisma will not generate TypeScript definitions for it. You must reference the enum in at least one model field to ensure it gets exported.
Missing generated Enum in typescript definition when Enum isn't used in Prisma table 3. Export/Import Issues in ESM/CJS:
There have been issues with how enums are exported in ESM builds, especially with the new
prisma-client generator. If you see errors like "Export named 'LMS' not found," double-check your import paths and ensure you’re not mixing ESM and CJS imports.bun run build error with prisma ^6.7.0
TypeError: __banner_node_url when using enums on the client-side 4. Potential Workaround:
If you need to import enums separately, consider re-exporting them from a custom file or using the workaround described in Separate enums and constants from the rest of the generated client. If these steps don't resolve your issue, please provide the specific error message and your generator config for more targeted help. 🤔 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.
