Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work for ESM modules #77

Open
olalonde opened this issue Feb 28, 2023 · 4 comments
Open

Doesn't work for ESM modules #77

olalonde opened this issue Feb 28, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@olalonde
Copy link

Bug description

All the imports would need to end with .js extension.

How to reproduce

Try to use in a ESM module.

Expected behavior

No response

Prisma information

Environment & setup

  • OS:
  • Database:
  • Node.js version:

Prisma Version


@omar-dulaimi
Copy link
Owner

@olalonde Is there really no way but to use a js extension?

@olalonde
Copy link
Author

olalonde commented Mar 3, 2023

That's the only way as far as I know. See https://www.typescriptlang.org/docs/handbook/esm-node.html

relative import paths need full extensions (e.g we have to write import "./foo.js" instead of import "./foo")

@omar-dulaimi omar-dulaimi added the enhancement New feature or request label Mar 5, 2023
@tylerR94
Copy link

Just curious if there's an update here? Did you manage to find any work arounds @olalonde Would hate to not use such an awesome package just because of this ESM constraint

@TravLRD
Copy link

TravLRD commented Aug 20, 2023

I would also be interested in a generator option for setting if you're using ESM modules of commonjs modules (like in packege.json). This is the only reason I can't use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants