Skip to content

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

@amirrezasalimi

Description

@amirrezasalimi

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions