wojtekmaj / react-pdf

Display PDFs in your React app as easily as if they were images.
https://projects.wojtekmaj.pl/react-pdf
MIT License
9.24k stars 877 forks source link

Getting sentry "t.split("+").at is not a function. (In 't.split("+").at(-1)', 't.split("+").at' is undefined" #1638

Closed harryi3t closed 11 months ago

harryi3t commented 11 months ago

Before you start - checklist

Description

We have been using react-pdf for a while now. Recently we migrated from 5.5.0 -> 7.2.0 and we started seeing a lot of sentry errors.

The error message in all these sentries is the same

t.split("+").at is not a function. (In 't.split("+").at(-1)', 't.split("+").at' is undefined

Since the react-pdf code is minified, I couldn't find the exact line from where this error is coming up. I then checked out the code in my local and tried searching for the keyword split but didn't find any useful there.

image

Maybe the error is coming from some dependency of reacy-pdf itself? I wonder if anyone else is facing the same issue.

Steps to reproduce

The issue happens without interacting with any pdf. Just by loading our home page we are seeing this error.

Expected behavior

We shouldn't see this error.

Actual behavior

We see this error

t.split("+").at is not a function. (In 't.split("+").at(-1)', 't.split("+").at' is undefined

Additional information

The stack trace from sentry

image

Environment

wojtekmaj commented 11 months ago

That may be 🤷‍♂️ Array.at, however, is supported by all modern browsers, including all which React-PDF currently supports.

Browser (if applicable): n/a

Given that you didn't provide this info, I'm assuming the above response is correct and you're seeing these reports coming from legacy browsers. Happy to reopen if proven otherwise.