Skip to content

Unhandled promise rejection: TypeError: can't access property "threshold", chosenPolicy is undefined #2183

@akselinurmio

Description

@akselinurmio

We're seeing a number of the following client-side errors in one of our web apps' application monitoring, that look like this:

Unhandled promise rejection: TypeError: can't access property "threshold", chosenPolicy is undefined
at <anonymous> (<anonymous code>:4802:38)

This doesn't seem to correlate with any of our organization's or dependencies' code, but according to a quick global Github search, this might originate from your code, specifically this line:

if (cookie.getExpiry() > chosenPolicy.threshold) {

My team and I would be glad if you could take a quick look into this, and see if you could either:

  1. catch this exception on your side, so that it doesn't show up in our logs, and/or
  2. find out what is causing this error and fix the reason it's showing up.

Error Sample

Here are some details of the error:

@timestamp
2026-01-01T20:21:22.893Z

url.original
https://areena.yle.fi/1-75616289

user_agent.original
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:146.0) Gecko/20100101 Firefox/146.0

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