Promise.withResolvers is throwing an error in pdf.js version 4.4.168

While using pdf.js 4.4.168 to display PDF files in the browser, I encountered an error when trying to open the site in Safari 16.4:

Unexpected Application Error!
Promise.withResolvers is not a function. (In 'Promise.withResolvers()', 'Promise.withResolvers' is undefined)
x_@https://tex.poemhub.top/assets/index--WBBKURE.js:35:156906
sV@https://tex.poemhub.top/assets/index--WBBKURE.js:35:152952
@https://tex.poemhub.top/assets/index--WBBKURE.js:45:77451
yl@https://tex.poemhub.top/assets/react-BFk0LVKl.js:32:24264
ur@https://tex.poemhub.top/assets/react-BFk0LVKl.js:32:42277
@https://tex.poemhub.top/assets/react-BFk0LVKl.js:32:40631
P@https://tex.poemhub.top/assets/react-BFk0LVKl.js:17:1585
oe@https://tex.poemhub.top/assets/react-BFk0LVKl.js:17:1954

After researching online, I found out that older browsers do not support Promise.withResolvers(), which requires us to upgrade the browser to resolve this issue. However, I still wanted users with older browser versions to be able to access the website. So, I attempted to switch to the legacy version of pdf.js. To do so, I downloaded the legacy version and replaced it with the current one from here: https://github.com/mozilla/pdf.js/releases/download/v4.4.168/pdfjs-4.4.168-legacy-dist.zip.

Even after replacing the pdf.worker.min.mjs file, the issue persisted. Here is the link to my legacy js file: . Am I overlooking something? What steps should I take to address this problem?

Answer №1

When encountering errors while running Cypress tests, it may be helpful to try using a different browser.

For me personally, I found that Electron was not sufficient while Chrome performed well.

npx cypress run --browser chrome

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to concatenate a data object?

This task should be quite straightforward. Using Vanilla JS, I am trying to update the content of a span element with the session ID obtained from a function call. Here's an example: sessionId = 0_77b1f7b5-b6c8-49a0-adbc-7883d662ebba document.getEle ...

Middleware for Socket.IO, utilizing io.use

I recently came across a post on Stack Overflow discussing the usage of middleware syntax in a web application built with expressJS and Socket.io. This was something new to me, as I had only seen middleware used with the express instance before. The exampl ...

Displaying Modal from a separate component

CardComponent: export class Card extends Component<Prop, State> { state = { isCancelModalOpen: false, }; marketService = new MarketService(); deleteMarket = () => { this.marketService .deleteMar( ...

The jQuery animation is smooth in Firefox, but experiencing issues in all other browsers

Upon window load, I have a rather large div animating from the left edge of the screen to expand across the entire width (achieved through a function triggered after a 2-second delay using setTimeout). This div contains a button that enables users to close ...

Shutting down the server following the completion of the mocha test, yet the data remains intact

Currently, I am working on testing some data using a REST API. The data is stored as an array within the project. My goal is to have the data "reset" every time a test suite runs, so that I can accurately determine the amount of data in the array. Howeve ...

Calculating the median in JavaScript utilizing a for loop

Currently, I am in the process of learning JavaScript. My goal is to calculate the median of a set of numbers that I input through a prompt when I click the button labeled "find median". function CalculateMedia() { var n = prompt("Enter the number of e ...

Tips for navigating through elements generated with ng-repeat as I scroll

There is a list generated using ng-repeat along with two buttons for moving up or down. Users have the option to select any item from the list and utilize the buttons to navigate through it. However, when I lower the selected item using the "go down" butt ...

Retrieving Twitter posts using the screen_name parameter in a Node.js environment

I am looking to create a website that allows users to enter the Twitter screen name of any celebrity. When the user clicks on the "show tweet" button, the latest tweet from that screen name will be displayed. I am interested in implementing this feature ...

How to Access ViewBag Value from Asp.Net in AngularJs Controller

Just getting started with AngularJs and encountering an issue with passing a value from a .Net MVC View to an AngularJs Controller. Here's the code snippet in question: AngularJs controller snippet: app.controller("RatingApiController", function ($s ...

Invoke a Wordpress shortcode using AJAX

Trying to implement a shortcode in Wordpress that can be triggered by clicking a button using jQuery. After researching various websites and tutorials, I am still having trouble understanding the issue. In my function.php file, I have the following code: ...

Having trouble retrieving Bengali-language data from the server using jQuery AJAX

I am facing an issue where I am unable to fetch data in Bengali language from the server using ajax. Strangely, the data retrieved from the server is getting replaced by some unknown characters. However, if I directly retrieve the data without using ajax, ...

Using Rails to render a partial with a JSON object

In my rails app, there is a javascript callback that runs after a post is created. This callback polls a processing endpoint to check if an image has finished processing and then updates the view accordingly: create.js.erb create callback // initiating t ...

What could be causing the child nodes of a particular class to not inherit the specified style?

When dynamically adding div child nodes to a search field, I do it like this: <div id="recommand" class="recommand"></div> data.result.forEach(function(entry) { let cont: rcommand; cont.username = entry[0]; const x = ...

JavaScript framework that is easily customizable to include support for XmlHttpRequest.onprogress, even if it needs to be emulated

Which JavaScript library or framework offers support for the "onprogress" event for XmlHttpRequest, even if it needs to be emulated using a plugin or extension? Alternatively, which JavaScript framework is the most straightforward to extend in order to add ...

Error: JavaScript alert not displaying

My asp.net page is not displaying the Javascript alert message until I clear the browser's cache memory. Can someone please explain why this happens and suggest a solution? ...

Chakra UI: How come the tooltip is appearing in the top left corner of the screen instead of directly above the element?

CreatedByModal is a unique chakra modal that incorporates tooltips. However, I am facing an issue where the tooltip appears at the top of the screen instead of directly above the icon when hovering over the icons. You can see in the image provided that the ...

Error: The value "'827'" cannot be assigned to "Course_Content.course_outline_id" as it must be a valid instance of "Course_Outline"

While working on my django view, I encountered an error stating: ValueError: Cannot assign '827': 'Course_Content.course_outline_id' must be a 'Course_Outline' instance. I attempted to convert it to an int but it still didn&ap ...

Struggling to get the AJAX code functioning correctly

Embarking on my journey with AJAX, I decided to test a simple example from the Microsoft 70515 book. Surprisingly, the code doesn't seem to be functioning as expected and I'm at a loss trying to figure out why - everything appears to be in order. ...

Navigate the scroll bar horizontally one by one instead of all at once, due to a width problem

The issue I'm facing involves determining the correct width for scrolling left or right. This results in the navigation tabs not scrolling correctly one by one. Each time I click the scroll right button, it adds more width than necessary and causes th ...

Images in HTML are misaligned after fetching data from the JSON file

Recently, I've been working on a website dedicated to the League of Legends game. The main feature of this site is that it utilizes the Riot API to fetch data about the mastery tree and then showcases the images related to it. Everything was going smo ...