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

ERR_PACKAGE_PATH_NOT_EXPORTED when using tsx with execa #673

Closed
4 of 6 tasks
ansf opened this issue Oct 31, 2024 · 2 comments
Closed
4 of 6 tasks

ERR_PACKAGE_PATH_NOT_EXPORTED when using tsx with execa #673

ansf opened this issue Oct 31, 2024 · 2 comments
Labels
bug Something isn't working pending triage

Comments

@ansf
Copy link

ansf commented Oct 31, 2024

Acknowledgements

  • I read the documentation and searched existing issues to avoid duplicates
  • I understand this is a bug tracker and anything other than a proven bug will be closed
  • I understand this is a free project and relies on community contributions
  • I read and understood the Contribution guide

Minimal reproduction URL

https://github.com/ansf/tsx-execa

Problem & expected behavior (under 200 words)

When using tsx with execa, I see an error Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in ./node_modules/unicorn-magic/package.json (see reproducer)

To be honest, I am not sure if this is an issue of tsx or execa (or unicorn-magic). So please let me know, if I should report it to execa instead. 👍

Bugs are expected to be fixed by those affected by it

  • I'm interested in working on this issue

Compensating engineering work will speed up resolution and support the project

  • I'm willing to offer $10 for financial support
@ansf ansf added bug Something isn't working pending triage labels Oct 31, 2024
@ansf
Copy link
Author

ansf commented Nov 4, 2024

Sorry, I found this issue, which describes the same issue and describes how to fix it on our side! 🙏
sindresorhus/execa#1159

@ansf ansf closed this as completed Nov 4, 2024
@privatenumber
Copy link
Owner

I actually ran into this myself as well.

The problem is happening because the import gets converted to require under the hood, so it doesn't actually get the import condition. But you can just pass that in yourself:

tsx -C import ./file

bluwy added a commit to vitejs/vite-plugin-basic-ssl that referenced this issue Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage
Projects
None yet
Development

No branches or pull requests

2 participants