Skip to content

[Compiler] Next.js 14 App Router build fails with lingo.dev #1696

@gurbaaz27

Description

@gurbaaz27
  1. pnpm dev seemed to work fine, and all the translations (dictionary.js, meta.json) indeed got generated in pnpm build, but later the build crashes. Tried multiple times. Have attached the build logs below.

  2. As said above, though the dev environment worked fine, I am seeing the following lint errors in my IDE (cursor)

  • layout.tsx
import { LingoProvider, loadDictionary } from "lingo.dev/react/rsc"
> Module '"lingo.dev/react/rsc"' has no exported member 'loadDictionary'.ts(2305)
Image
  • LocaleSwitcher.tsx
import { useLingoLocale, setLingoLocale } from "lingo.dev/react/client"
> Module '"lingo.dev/react/client"' has no exported member 'setLingoLocale'.ts(2305)
  • package.json
    "lingo.dev": "^0.117.21",
  • next.config.js
import lingoCompiler from "lingo.dev/compiler"

...

const withLingo = lingoCompiler.next({
  sourceRoot: "app", // Default for Next.js
  lingoDir: "lingo", // Translation files directory
  sourceLocale: "en",
  targetLocales: ["es", "zh", "ja"],
  rsc: true, // Enable React Server Components support
  useDirective: false,
  debug: true, // Enable debug logging
  models: {
    "*:*": "openrouter:mistral/mistral-small-24b-instruct-2501",
  },
  //"lingo.dev",
})

export default withLingo(nextConfig)
  • pnpm build
> next build

  ▲ Next.js 14.2.3
  - Environments: .env

   Creating an optimized production build ...
Applying Lingo.dev webpack configuration...
Applying Lingo.dev webpack configuration...
Applying Lingo.dev webpack configuration...
ℹ️  Starting Lingo.dev compiler...

🌼 daisyUI components 2.52.0  https://daisyui.com
  ✔︎ Including:  base, components, 1 themes, utilities
  ❤︎ Support daisyUI:  https://opencollective.com/daisyui 
  
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/gurbaaz/<redacted-project>/node_modules/.pnpm/@lingo.dev+_compiler@0.8.8_babel-plugin-macros@3.1.0_react@19.2.3/node_modules/@lingo.dev/_compiler/build/chunk-VG5I5JDL.mjs for build dependencies failed at 'import(pathToFileURL2(file).href)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/gurbaaz/<redacted-project>/node_modules/.pnpm/@lingo.dev+_compiler@0.8.8_babel-plugin-macros@3.1.0_react@19.2.3/node_modules/@lingo.dev/_compiler/build/chunk-VG5I5JDL.mjs for build dependencies failed at 'import(url3)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/gurbaaz/<redacted-project>/node_modules/.pnpm/@lingo.dev+_compiler@0.8.8_babel-plugin-macros@3.1.0_react@19.2.3/node_modules/@lingo.dev/_compiler/build/chunk-VG5I5JDL.mjs for build dependencies failed at 'import(name)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/gurbaaz/<redacted-project>/node_modules/.pnpm/@lingo.dev+_compiler@0.8.8_babel-plugin-macros@3.1.0_react@19.2.3/node_modules/@lingo.dev/_compiler/build/chunk-VG5I5JDL.mjs for build dependencies failed at 'import(pathToFileURL5(name).href)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/gurbaaz/<redacted-project>/node_modules/.pnpm/@lingo.dev+_compiler@0.8.8_babel-plugin-macros@3.1.0_react@19.2.3/node_modules/@lingo.dev/_compiler/build/chunk-VG5I5JDL.mjs for build dependencies failed at 'import(pathToFileURL5(path12.resolve(name)).href)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
ℹ️  Starting Lingo.dev compiler...
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/gurbaaz/<redacted-project>/node_modules/.pnpm/@lingo.dev+_compiler@0.8.8_babel-plugin-macros@3.1.0_react@19.2.3/node_modules/@lingo.dev/_compiler/build/chunk-VG5I5JDL.mjs for build dependencies failed at 'import(pathToFileURL2(file).href)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/gurbaaz/<redacted-project>/node_modules/.pnpm/@lingo.dev+_compiler@0.8.8_babel-plugin-macros@3.1.0_react@19.2.3/node_modules/@lingo.dev/_compiler/build/chunk-VG5I5JDL.mjs for build dependencies failed at 'import(url3)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/gurbaaz/<redacted-project>/node_modules/.pnpm/@lingo.dev+_compiler@0.8.8_babel-plugin-macros@3.1.0_react@19.2.3/node_modules/@lingo.dev/_compiler/build/chunk-VG5I5JDL.mjs for build dependencies failed at 'import(name)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/gurbaaz/<redacted-project>/node_modules/.pnpm/@lingo.dev+_compiler@0.8.8_babel-plugin-macros@3.1.0_react@19.2.3/node_modules/@lingo.dev/_compiler/build/chunk-VG5I5JDL.mjs for build dependencies failed at 'import(pathToFileURL5(name).href)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/gurbaaz/<redacted-project>/node_modules/.pnpm/@lingo.dev+_compiler@0.8.8_babel-plugin-macros@3.1.0_react@19.2.3/node_modules/@lingo.dev/_compiler/build/chunk-VG5I5JDL.mjs for build dependencies failed at 'import(pathToFileURL5(path12.resolve(name)).href)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
ℹ️  Starting Lingo.dev compiler...

🌼 daisyUI components 2.52.0  https://daisyui.com
  ✔︎ Including:  base, components, 1 themes, utilities
  ❤︎ Support daisyUI:  https://opencollective.com/daisyui 
  
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/gurbaaz/<redacted-project>/node_modules/.pnpm/@lingo.dev+_compiler@0.8.8_babel-plugin-macros@3.1.0_react@19.2.3/node_modules/@lingo.dev/_compiler/build/chunk-VG5I5JDL.mjs for build dependencies failed at 'import(pathToFileURL2(file).href)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/gurbaaz/<redacted-project>/node_modules/.pnpm/@lingo.dev+_compiler@0.8.8_babel-plugin-macros@3.1.0_react@19.2.3/node_modules/@lingo.dev/_compiler/build/chunk-VG5I5JDL.mjs for build dependencies failed at 'import(url3)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/gurbaaz/<redacted-project>/node_modules/.pnpm/@lingo.dev+_compiler@0.8.8_babel-plugin-macros@3.1.0_react@19.2.3/node_modules/@lingo.dev/_compiler/build/chunk-VG5I5JDL.mjs for build dependencies failed at 'import(name)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/gurbaaz/<redacted-project>/node_modules/.pnpm/@lingo.dev+_compiler@0.8.8_babel-plugin-macros@3.1.0_react@19.2.3/node_modules/@lingo.dev/_compiler/build/chunk-VG5I5JDL.mjs for build dependencies failed at 'import(pathToFileURL5(name).href)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /Users/gurbaaz/<redacted-project>/node_modules/.pnpm/@lingo.dev+_compiler@0.8.8_babel-plugin-macros@3.1.0_react@19.2.3/node_modules/@lingo.dev/_compiler/build/chunk-VG5I5JDL.mjs for build dependencies failed at 'import(pathToFileURL5(path12.resolve(name)).href)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.

<--- Last few GCs --->

[33768:0x138008000]   116618 ms: Scavenge (during sweeping) 1989.8 (2052.3) -> 1986.1 (2052.3) MB, pooled: 0.0 MB, 2.07 / 0.00 ms (average mu = 0.438, current mu = 0.534) allocation failure; 
[33768:0x138008000]   118371 ms: Mark-Compact 2114.3 (2175.6) -> 2013.0 (2093.4) MB, pooled: 0.0 MB, 1540.84 / 0.00 ms (average mu = 0.455, current mu = 0.470) allocation failure; GC in old space requested

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 0x108fdcd5c node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
 2: 0x10918863c v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
 3: 0x1091885f4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
 4: 0x10933691c v8::internal::Heap::ShouldOptimizeForLoadTime() const [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
 5: 0x109335fd8 v8::internal::Heap::EagerlyFreeExternalMemoryAndWasmCode() [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
 6: 0x109334ee8 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags, v8::internal::PerformHeapLimitCheck) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
 7: 0x10932d3b4 std::__1::invoke_result<v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment, v8::internal::AllocationHint)::$_0&>::type v8::internal::HeapAllocator::CollectGarbageAndRetryAllocation<v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment, v8::internal::AllocationHint)::$_0&>(v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment, v8::internal::AllocationHint)::$_0&, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
 8: 0x10932c220 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment, v8::internal::AllocationHint) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
 9: 0x109302f84 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawArray(int, v8::internal::AllocationType, v8::internal::AllocationHint) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
10: 0x109302c6c v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArrayWithFiller(v8::internal::DirectHandle<v8::internal::Map>, int, v8::internal::DirectHandle<v8::internal::HeapObject>, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
11: 0x10955fc9c v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, 2>::Allocate(v8::internal::Isolate*, int, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
12: 0x10955f4fc v8::internal::DirectHandle<v8::internal::OrderedHashMap>::MaybeType v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, 2>::Rehash<v8::internal::DirectHandle>(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::OrderedHashMap>, int) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
13: 0x10961c980 v8::internal::Runtime_MapGrow(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
14: 0x108dfd474 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
15: 0x108dc4790 Builtins_MapPrototypeSet [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
16: 0x15056b560 
17: 0x1500ecb9c 
18: 0x15056b364 
19: 0x1500ecb9c 
20: 0x15056b364 
21: 0x150fd6558 
22: 0x151b57660 
23: 0x15056b364 
24: 0x150fd62e8 
25: 0x151ae1444 
26: 0x15056b364 
27: 0x151adf088 
28: 0x108d5d5ec Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
29: 0x151b57660 
30: 0x15056b364 
31: 0x151aadecc 
32: 0x151aae994 
33: 0x151aae884 
34: 0x150cffb44 
35: 0x151aae7a4 
36: 0x150cffb44 
37: 0x151065244 
38: 0x108d9b4c4 Builtins_AsyncFunctionAwaitResolveClosure [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
39: 0x108e72058 Builtins_PromiseFulfillReactionJob [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
40: 0x108d8a920 Builtins_RunMicrotasks [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
41: 0x108d5a850 Builtins_JSRunMicrotasksEntry [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
42: 0x10929ee18 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
43: 0x10929f4c8 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
44: 0x10929f5b8 v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate*, v8::internal::MicrotaskQueue*) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
45: 0x1092c17c8 v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
46: 0x1092c15e4 v8::internal::MicrotaskQueue::PerformCheckpointInternal(v8::Isolate*) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
47: 0x108f34b54 node::InternalCallbackScope::Close() [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
48: 0x108f34eb4 node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context, v8::Local<v8::Value>) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
49: 0x108f40d70 node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
50: 0x108fe0b88 node::fs::FSReqCallback::Reject(v8::Local<v8::Value>) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
51: 0x108fe10d4 node::fs::FSReqAfterScope::Reject(uv_fs_s*) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
52: 0x108fe1138 node::fs::FSReqAfterScope::Proceed() [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
53: 0x109e1a05c node::fs::AfterNoArgs(uv_fs_s*) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
54: 0x108fd7944 node::MakeLibuvRequestCallback<uv_fs_s, void (*)(uv_fs_s*)>::Wrapper(uv_fs_s*) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
55: 0x10501e034 uv__work_done [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
56: 0x105021974 uv__async_io [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
57: 0x105031fa8 uv__io_poll [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
58: 0x105021e08 uv_run [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
59: 0x108f355c8 node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
60: 0x109007e60 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
61: 0x109007b94 node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
62: 0x108fb5f30 node::Start(int, char**) [/opt/homebrew/Cellar/node/25.2.1/lib/libnode.141.dylib]
63: 0x19a9cab98 start [/usr/lib/dyld]
 ELIFECYCLE  Command failed.

Any help/insights would be appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions