将构建打包后的代码嵌入到uniapp中,运行出现Uncaught TypeError: Promise.withResolvers is not a function
bash复制代码
10:30:27.935 同步手机端程序文件完成
10:30:29.098 正在启动HBuilder调试基座...
10:30:30.103 应用【移动端测试】已启动
10:30:30.294 [Object] {"errMsg":"reLaunch:fail page `/` is not found"} at permission.js:37
10:30:30.807 Uncaught TypeError: Promise.withResolvers is not a function at hybrid/html/web/viewer.mjs:24062
var validateFileURL = function (file) {
if (!file) {
return;
}
try {
const viewerOrigin = new URL(window.location.href).origin || "null";
if (HOSTED_VIEWER_ORIGINS.includes(viewerOrigin)) {
// Hosted or local viewer, allow for any file locations
return;
}
const fileOrigin = new URL(file, window.location.href).origin;
// Removing of the following line will not guarantee that the viewer will
// start accepting URLs from foreign origin -- CORS headers on the remote
// server must be properly configured.
//去掉下面这段==========================
/*if (fileOrigin !== viewerOrigin) {
throw new Error("file origin does not match viewer's");
}*/
} catch (ex) {
PDFViewerApplication._documentError("pdfjs-loading-error", {
message: ex.message,
});
throw ex;
}
};