Next.js Discord

Discord Forum

`ReferenceError: Cannot access '$r' before initialization` ... what does that even mean?

Unanswered
Chinese Egret posted this in #help-forum
Open in Discord
Chinese EgretOP
Occasionally some changes i make cause it to fail with this error. I have no clue what it means, or what changes cause it to fail this way

  ~/../4nswer.me ❯ pnpm build

> 4nswer.me@0.1.0 build /home/riley/programming/4nswer.me
> next build

   ▲ Next.js 15.3.2
   - Environments: .env

   Creating an optimized production build ...
<w> [webpack.cache.PackFileCacheStrategy] Serializing big strings (121kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)
 ✓ Compiled successfully in 13.0s
 ✓ Linting and checking validity of types
   Collecting page data  ...ReferenceError: Cannot access '$r' before initialization
    at 64700 (.next/server/app/api/rpc/route.js:151:6480)
    at t (.next/server/webpack-runtime.js:1:128)
    at r (.next/server/app/api/rpc/route.js:152:1147481)
    at <unknown> (.next/server/app/api/rpc/route.js:152:1147508)
    at t.X (.next/server/webpack-runtime.js:1:1206)
    at <unknown> (.next/server/app/api/rpc/route.js:152:1147494)
    at Object.<anonymous> (.next/server/app/api/rpc/route.js:152:1147536)

> Build error occurred
[Error: Failed to collect page data for /api/rpc] { type: 'Error' }
 ELIFECYCLE  Command failed with exit code 1.

0 Replies