From 36ba854d3f5531060e5a816b57119218323b764d Mon Sep 17 00:00:00 2001 From: Leechael Yim Date: Thu, 4 Jul 2024 23:23:44 +0800 Subject: [PATCH 1/2] fix: handling promise rejection in built artifact --- src/lib/runWebpack.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/runWebpack.ts b/src/lib/runWebpack.ts index a45ff39..d168e30 100644 --- a/src/lib/runWebpack.ts +++ b/src/lib/runWebpack.ts @@ -15,7 +15,7 @@ export const MAX_BUILD_SIZE = 1024 * 400 const BUILD_ASYNC_CODE_TEMPLATE = ` import main from '{filePath}'; - main.apply(null, globalThis.scriptArgs).then(result => globalThis.scriptOutput = result); + main.apply(null, globalThis.scriptArgs).then(result => globalThis.scriptOutput = result).catch(err => globalThis.scriptOutput = JSON.stringify({error: err, success: false})); ` const BUILD_CODE_TEMPLATE = ` From c1d7506936b12bea465b497cb89b9306c4a67bd9 Mon Sep 17 00:00:00 2001 From: Leechael Yim Date: Fri, 5 Jul 2024 10:57:51 +0800 Subject: [PATCH 2/2] chore: version 0.2.20 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 562d6aa..c7e8f0a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@phala/fn", - "version": "0.2.19", + "version": "0.2.20", "description": "Phat Function CLI toolkit", "bin": { "phat-fn": "bin/run"