Lingo.dev compiler fails with “TypeError: traverse is not a function” in React Router v7 + Vite
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
- Created an empty react router project
- Config
- 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
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.
It seems fixed in 0.117.1 😄