From e0740f93d07bc902ea3202b268f1138b5c957f68 Mon Sep 17 00:00:00 2001 From: tamaina Date: Fri, 29 Apr 2022 00:43:50 +0900 Subject: [PATCH] revert boot import --- packages/backend/src/server/web/boot.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/server/web/boot.js b/packages/backend/src/server/web/boot.js index 522a3f7d83..43f8553abd 100644 --- a/packages/backend/src/server/web/boot.js +++ b/packages/backend/src/server/web/boot.js @@ -58,11 +58,14 @@ ? `?salt=${localStorage.getItem('salt')}` : ''; - import(`/assets/${CLIENT_ENTRY}${salt}`) - .catch(async () => { - await checkUpdate(); - renderError('APP_FETCH_FAILED'); - }); + const script = document.createElement('script'); + script.setAttribute('src', `/assets/${CLIENT_ENTRY}${salt}`); + script.setAttribute('type', 'module'); + script.addEventListener('error', async () => { + await checkUpdate(); + renderError('APP_FETCH_FAILED'); + }); + document.head.appendChild(script); //#endregion //#region Theme