peopledatalabs / peopledatalabs-js

A universal JS client with TypeScript support for the People Data Labs API
https://docs.peopledatalabs.com/docs/javascript-sdk
MIT License
22 stars 9 forks source link

cannot instantiate PDL with new keyword throws ERROR [ExceptionHandler] peopledatalabs_1.default is not a constructor #243

Closed faithfulojebiyi closed 3 months ago

faithfulojebiyi commented 3 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior: import it into a nestjs code base without esModuleInterop set to true

Screenshot 2024-07-24 at 10 55 50

Expected behavior should work out of the box i tried import * as ... still did not work A clear and concise description of what you expected to happen.

Screenshots

Screenshot 2024-07-24 at 10 53 46

If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here. i dont wan to set esModuleInterop to true this will mess up other imports. I believe this is relate to how this package is bundled.

faithfulojebiyi commented 3 months ago

Any updates on this

vvillait88 commented 3 months ago

@faithfulojebiyi Thanks for opening the issue. We are looking into it and should have a followup next week if we can accommodate this request.

vvillait88 commented 3 months ago

@faithfulojebiyi After investigation, we will not be supporting esModuleInterop turned off. We looked into other libraries and saw this was pretty common practice. If your project needs this setting turned off, we suggest either hitting the APIs directly or forking this library and making the adjustments you need.