Promise.withResolvers 是ES2024 中引入的一个新特性,它允许你更方便地创建和解决 Promise。如果你的环境中出现 promise.withresolvers is not a function 的错误,很可能是因为你的环境不支持这个新特性。 解决方案 升级环境: 确保你的 JavaScript 运行环境(如浏览器或 Node.js)是最新的,或者至少是支持 ES2024 ...
1.Error occurs when opening PDF in electron app What is the expected behavior? Open PDF in read mode What went wrong? pdf.mjs:11172 Uncaught (in promise) TypeError: Promise.withResolvers is not a function at new PDFDocumentLoadingTask (pdf.mjs:11172:1) at Module.getDocument (pdf.mjs:109...
Open a PDF with Chrome 98 (nominally supported). It should error with Promise.withResolvers is not a function. (In 'Promise.withResolvers()', 'Promise.withResolvers' is undefined) because Chrome 98 does not implement Promise.withResolvers. What is the expected behavior? The list in gulp...
babel-helper-get-function-arity@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" dependencies: ...
TypeError: Promise.withResolvers is not a function PDF.js uses Promise.withResolvers(), which is a brand new feature in JavaScript. In case your target environment does not support this, you need to add the following code to the first line of pdf.min.mjs and pdf.worker.min.mjs to reso...
The latest PDF.js v4.3.136 uses Promise.withResolvers, which may not be supported in all environments, such as Node < 22. Consider to use the bundled serverless build, which includes a polyfill, or use an older version of PDF.js.// Before using any other method, define the PDF.js mo...
[1]; please see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers The only difference is that `PromiseCapability` also had a `settled`-getter, which was however not widely used and the call-sites can either be removed or re-factored to ...
withResolvers(); 208 + 209 + const streamGenerator1 = (async function* () { 210 + for (const item of items1) { 211 + yield { items: [item], styles, lang }; 212 + await waitCapability1.promise; 213 + } 214 + })(); 215 + const streamGenerator2 = (async ...
In my case it fails to define an import for canvas or path2d, and calling NodeCanvasFactory (as is done in the node example) gives the error reported in the original issue. if (isNodeJS) { var packageCapability = Promise.withResolvers(); var packageMap = null; const loadPackages = ...
We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Cancel Create saved search Sign in Sign up Reseting focus {...