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.

Generate cause a typescript error with exported enum

See original GitHub issue

Bug 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

  1. 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:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aqrlncommented, Jun 14, 2022

Thanks for the additional details!

Unfortunately I don’t see how we can help here. Should I go ahead and close the issue?

1reaction
tomappcommented, Jun 13, 2022

Alright, sorry I got confused with the librairies, I’m using tsed actually. That’s tsed which meet troubles while building from prisma.

Read more comments on GitHub >

github_iconTop 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 >

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