Skip to content

Conversation

@AleksandrSl
Copy link
Collaborator

@AleksandrSl AleksandrSl commented Nov 25, 2025

Summary

Fixes #1636

Babel still ships the older CJS, and when importing it from ESM or CJS the imported value differs.
There is a wait to import with .default import * as traverse from "@babel/traverse" in node as well, but then TS is not happy, so the more hacky but robust fix is to reexport the functions correctly checking the way it's imported in runtime

Changes

  • [Key change 1]
  • [Key change 2]

Testing

Business logic tests added:

  • [Describe test 1 - what behavior it validates]
  • [Describe test 2 - what edge case it covers]
  • All tests pass locally

Visuals

Required for UI/UX changes:

  • Before/after screenshots attached
  • Video demo for interactions (< 30s)

Checklist

  • Changeset added (if version bump needed)
  • Tests cover business logic (not just happy path)
  • No breaking changes (or documented below)

Closes #[issue-number]

@AleksandrSl AleksandrSl marked this pull request as draft November 25, 2025 23:33
@AleksandrSl AleksandrSl changed the title 🚧 Babel CJS/ESM fix compiler: babel CJS/ESM fix Nov 25, 2025
@AleksandrSl AleksandrSl marked this pull request as ready for review November 25, 2025 23:43
@vrcprl vrcprl changed the title compiler: babel CJS/ESM fix fix: babel CJS/ESM in the compiler Nov 26, 2025
@vrcprl vrcprl merged commit ec2f00a into main Nov 26, 2025
3 checks passed
@vrcprl vrcprl deleted the fix/cjs-esm-fix branch November 26, 2025 00:58
The-Best-Codes pushed a commit to The-Best-Codes/lingo.dev that referenced this pull request Dec 3, 2025
* WIP

* chore: fix types

* chore: add changeset

---------

Co-authored-by: Veronica Prilutskaya <[email protected]>
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.

Lingo.dev compiler fails with “TypeError: traverse is not a function” in React Router v7 + Vite

3 participants