-
-
Notifications
You must be signed in to change notification settings - Fork 797
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
Load TypeScript in ESM mode if package.json type is module #1849
Conversation
@henrist Thank you for the PR! Can you create new test for this? |
@DorianMazur Test added (and added a missing inclusion of the commonjs variant). Making the test fail before my fixes requires a bit of code. For context this is the error: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /Users/henrste/repo/node_modules/dependency/package.json
at exportsNotFound (node:internal/modules/esm/resolve:314:10)
at packageExportsResolve (node:internal/modules/esm/resolve:605:13)
at resolveExports (node:internal/modules/cjs/loader:638:36)
at Function._findPath (node:internal/modules/cjs/loader:743:31)
at node:internal/modules/cjs/loader:1230:27
at nextResolveSimple (/Users/henrste/repo/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/register-DCnOAxY2.cjs:3:942)
at /Users/henrste/repo/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/register-DCnOAxY2.cjs:2:2550
at /Users/henrste/repo/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/register-DCnOAxY2.cjs:2:1624
at resolveTsPaths (/Users/henrste/repo/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/register-DCnOAxY2.cjs:3:760)
at Function._resolveFilename (/Users/henrste/repo/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/register-DCnOAxY2.cjs:3:1038) When a package declares conditional exports using the |
@DorianMazur I think the failed tests are flakes in the repo (I see others failing too). Can you confirm? |
Thanks! It should be included in the next version. |
@DorianMazur Could you run me through the process of creating a release please? |
Description
Closes #1848
Motivation and Context
See #1848
How Has This Been Tested?
Tested on a service locally that failed previously. See #1848 for environment details.
Screenshots (if appropriate):
N/A