lingo.dev icon indicating copy to clipboard operation
lingo.dev copied to clipboard

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

Open amirrezasalimi opened this issue 3 months ago • 2 comments

What's happening?

First of all, thanks for the awesome project!

I’m running into an issue when using React Router v7+ with Vite. When starting the development server, the Lingo.dev compiler fails during localization.

Exact Reproduction Steps

  1. Created an empty react router project
  2. Config
  3. Run

Logs

ℹ️ Starting Lingo.dev compiler...

🔑 LLM API keys detected for configured providers: lingo.dev. • Lingo.dev API key loaded from environment variables (LINGODOTDEV_API_KEY).

✨ ➜ Local: http://localhost:5173/ ➜ Network: http://192.168.1.68:5173/ ➜ Network: http://10.125.0.14:5173/ ➜ press h + enter to show help

⚠️ Lingo.dev compiler failed to localize your app ⚠️ Details: TypeError: traverse is not a function at _hasFileDirective (file:///Users/jarvis/Dev/dana/node_modules/@lingo.dev/_compiler/build/chunk-SRWLOKRJ.mjs:20393:3) at hasI18nDirective (file:///Users/jarvis/Dev/dana/node_modules/@lingo.dev/_compiler/build/chunk-SRWLOKRJ.mjs:20404:10) at file:///Users/jarvis/Dev/dana/node_modules/@lingo.dev/_compiler/build/chunk-SRWLOKRJ.mjs:20529:39 at file:///Users/jarvis/Dev/dana/node_modules/@lingo.dev/_compiler/build/chunk-SRWLOKRJ.mjs:10:20 at file:///Users/jarvis/Dev/dana/node_modules/@lingo.dev/_compiler/build/chunk-SRWLOKRJ.mjs:35:34 at Function.thru (/Users/jarvis/Dev/dana/node_modules/lodash/lodash.js:8859:14) at /Users/jarvis/Dev/dana/node_modules/lodash/lodash.js:4430:28 at arrayReduce (/Users/jarvis/Dev/dana/node_modules/lodash/lodash.js:697:21) at baseWrapperValue (/Users/jarvis/Dev/dana/node_modules/lodash/lodash.js:4429:14) at LodashWrapper.wrapperValue (/Users/jarvis/Dev/dana/node_modules/lodash/lodash.js:9114:14)

⚠️ Lingo.dev compiler failed to localize your app ⚠️ Details: TypeError: traverse is not a function

amirrezasalimi avatar Nov 25 '25 00:11 amirrezasalimi

I'm getting the same error in the same setup.

It is not happening on version 0.115.0, but start happening on 0.116.1 and later.

Aulos avatar Nov 25 '25 21:11 Aulos

It seems fixed in 0.117.1 😄

Aulos avatar Nov 27 '25 18:11 Aulos