From ad9f22857d99cac513ad00dfd85337306ec151fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 20 Jan 2023 15:05:41 +0100 Subject: [PATCH] :zap: Restore `is not a function` error --- packages/workflow/src/Expression.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/workflow/src/Expression.ts b/packages/workflow/src/Expression.ts index 8817bb7da92..fc7134f186e 100644 --- a/packages/workflow/src/Expression.ts +++ b/packages/workflow/src/Expression.ts @@ -309,6 +309,19 @@ export class Expression { ) { throw new Error('invalid syntax'); } + + if ( + typeof process === 'undefined' && + error instanceof Error && + error.name === 'TypeError' && + error.message.endsWith('is not a function') + ) { + const match = error.message.match(/(?[^.]+is not a function)/); + + if (!match?.groups?.msg) return null; + + throw new Error(match.groups.msg); + } } return null; }