Next.js Discord

Discord Forum

Unhandled error on Production from framework

Unanswered
Cyanide posted this in #help-forum
Open in Discord
On newrelic we are getting error

Error: Unhandled Promise Rejection: Cannot read properties of undefined (reading 'call')


    if (cachedModule !== undefined) {
        return cachedModule.exports;
    }
    // Create a new module (and put it into the cache)
    var module = __webpack_module_cache__[moduleId] = {
        id: moduleId,
        loaded: false,
        exports: {}
    };

    // Execute the module function
    var threw = true;
    try {
        __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
        threw = false;
    } finally {
        if(threw) delete __webpack_module_cache__[moduleId];
    }

    // Flag the module as loaded
    module.loaded = true;

    // Return the exports of the module
    return module.exports;
}

// expose the modules object (__webpack_modules__)


No such warning or errro comes in prod and dev in many of our devices that we tested internally. This error is irrespective of device or page, And error count is also quite high. It seems that it is directly coming from webpack. No reason or stack trace from our source code, Neither we have been able to simulate. We are not sure what's actual happening with our app on user's end. Checked a lot on web but no hints, There are several such errors coming directly from NextJS 14.2.3 App Router, framework with none of our source code in stack trace. Unfortunately we couldn't find solution of any of those on web but yes several people have opened threads of such errors in several places. Can anyone please help with it?

Happy to share any information if required for debugging.

6 Replies

Bumping this up, Can anyone help with this?
The error is really cryptic, can’t really tell anything. Maybe check back the commit history and find the commit where the error started coming. Any suspicious things happening in that commit? Is it a dependency upgrade commit?
@joulev Yes right, unfortunately it didn't came up with just one change. Also it didn't came up in dev or staging for us. As our app went into production after all the changes it started coming up for users. While I had open this issue, It once came on my device as well, just to confirm it didn't break anything on the client. But was just coming up in the console. I tried checking the stack trace on the client but it is just the same as on newrelic.

https://stackoverflow.com/questions/74832268/typeerror-cannot-read-properties-of-undefined-reading-call-on-next-js This is something similar but not old, I tried changing the next 14.X versions but didn't helped.
https://github.com/vercel/next.js/issues/5152 Another similar one but no proper resolution, Can't just install next canary as it could lead to more such random issues.
issues like these are the worst, really cant debug at all. in prod i also face this random error Cannot read properties of undefined (reading 'length') that cannot be tracked to any particular commits and cannot be reproduced. it also doesnt break anything so we just decided to ignore it for now
Got it, Thanks. However how can we highlight these to Next team? Atleast they would have the most idea and could possibly debug this?
opening an issue on github is the best you can do