Skip to content

attribution property can be undefined #264

@ArgonAlex

Description

@ArgonAlex

Using the attribution build, I was seeing Uncaught TypeError: Cannot read property 'largestShiftTarget' of undefined errors in our client logs. Unfortunately this means we missed tracking some CLS events until we could deploy a fix with a truthy check for attribution.

Our usage is very similar to the documentation, which will also run into this error because there is no truthy check for attribution.

It seems that either:
a) The TS typings and documentation should be updated to take into account attribution possibly being undefined
or
b) The code should be updated so attribution is always at least an empty object

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