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

fix: resolved an issue where types were not being properly picked up in some ESM TS projects (resolves #62) #64

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

ClockRide
Copy link
Contributor

@ClockRide ClockRide commented Jun 3, 2024

Resolves #62.

I found that this package was causing type errors in my application. The proposed solution is the least intrusive I have found. I considered overhauling the bundling pipeline altogether using something like Rollup. While it seems to be a better way of achieving ESM+CJS compatibility, it could present breaking changes and have all kinds of side effects, so I opted for patching package.json instead.

References:
https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseCJS.md (In-Depth about "Masquerading as CJS" problem)
microsoft/TypeScript#52363 (comment) (TL;DR solution)

@B4nan B4nan requested a review from vladfrangu June 3, 2024 06:23
Copy link
Member

@vladfrangu vladfrangu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, unfortunately this is more less the only way, although I've had issues with referencing the same file before. If this works, LGTM, otherwise we may need to overhaul the build script 🫠

@B4nan B4nan merged commit 6a20007 into apify:master Jun 3, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trouble using with TS Node16 moduleResolution
3 participants