Generate cause a typescript error with exported enum
See original GitHub issueBug description
Hello,
I meet an issue while trying to build my project. I get this error
prisma/generated/tsed/index.ts:3:1 - error TS2308: Module "./client" has already exported a member named 'MyEnum'. Consider explicitly re-exporting to resolve the ambiguity.
Because of the index file generated :
export * from "./client"; export * from "./interfaces"; export * from "./enums"; export * from "./models"; export * from "./services/PrismaService"; export * from "./repositories";
How to reproduce
npm run build
Expected behavior
Having my dist
folder compiled without any typescript error.
Prisma information
I would like to keep it to myself as much as possible.
Environment & setup
- OS: Windows
- Database: PostgreSQL
- Node.js version: 16.14.2
Prisma Version
3.15.0
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Exporting enum in `.d.ts` leads to „Can't resolve” error
A; So now my real question is: Is this due to the fact that TypeScript doesn't inline enum values into constants (unless you're...
Read more >The trouble with TypeScript enums - Thoughtbot
In TypeScript, enums have a few surprising limitations. ... with enums can be particularly pervasive and lead to uncaught runtime errors.
Read more >(Enum) cannot read property of undefined Error in TS
The enum error - cannot read property of undefined occurs for 2 main reasons, using const enums that get removed during compilation.
Read more >TypeScript errors and how to fix them
Add an import, export, or an empty 'export {}' statement to make it a module. Broken Code ❌. tsconfig.json. 1 2 3
Read more >KJS: .d.ts generation not working for enum classes : KT-37916
I spent some time today looking at how the typescript generation is implemented. To make this work the following would need to happen:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the additional details!
Unfortunately I don’t see how we can help here. Should I go ahead and close the issue?
Alright, sorry I got confused with the librairies, I’m using tsed actually. That’s tsed which meet troubles while building from prisma.