P
Prisma•5mo ago
piscopancer

Error when building package that uses Prisma types

as i run my tsup build command, i get this error coming from generated prisma folder
Error: ImportEquals should have a literal source.

5 |
6 | import * as runtime from './runtime/library.js';
> 7 | import $Types = runtime.Types // general types
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8 | import $Public = runtime.Types.Public
9 | import $Utils = runtime.Types.Utils
10 | import $Extensions = runtime.Types.Extensions
Error: ImportEquals should have a literal source.

5 |
6 | import * as runtime from './runtime/library.js';
> 7 | import $Types = runtime.Types // general types
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8 | import $Public = runtime.Types.Public
9 | import $Utils = runtime.Types.Utils
10 | import $Extensions = runtime.Types.Extensions
this error occurs when tsup generates DTS the type i export with my package is
type FindFirstField = Prisma.Args<typeof db.field, 'findFirst'>
type FindFirstField = Prisma.Args<typeof db.field, 'findFirst'>
(if i do not include this package in the exported index.ts, it all works)
5 Replies
Prisma AI Help
Prisma AI Help•5mo ago
You selected the carefully hand-crafted route. A dev artisan will respond soon. Meanwhile, the #ask-ai channel awaits if you're curious!
piscopancer
piscopancerOP•5mo ago
here's the full error
Nurul
Nurul•5mo ago
Is this happening in the latest prisma version 6.12.0?
piscopancer
piscopancerOP•5mo ago
I guess if I move to the latest version, the error will be gone, lemme check thanks it did work
Nurul
Nurul•5mo ago
Thanks for checking! I am glad to hear that it worked 🙌

Did you find this page helpful?