diff --git a/.changeset/late-toes-remain.md b/.changeset/late-toes-remain.md new file mode 100644 index 0000000000000..47e19b7a77e0b --- /dev/null +++ b/.changeset/late-toes-remain.md @@ -0,0 +1,6 @@ +--- +'@rocket.chat/meteor': patch +'@rocket.chat/apps-engine': patch +--- + +Fixes an issue where app installation would fail if the app package contained JS syntax newer than 2017 diff --git a/packages/apps-engine/deno-runtime/lib/ast/mod.ts b/packages/apps-engine/deno-runtime/lib/ast/mod.ts index d4f0f5858a281..555b4defc36a0 100644 --- a/packages/apps-engine/deno-runtime/lib/ast/mod.ts +++ b/packages/apps-engine/deno-runtime/lib/ast/mod.ts @@ -50,7 +50,8 @@ function fixAst(ast: Program): boolean { export function fixBrokenSynchronousAPICalls(appSource: string): string { const astRootNode = parse(appSource, { - ecmaVersion: 2017, + // Latest ecma version supported by this version of acorn. + ecmaVersion: "latest", // Allow everything, we don't want to complain if code is badly written // Also, since the code itself has been transpiled, the chance of getting // shenanigans is lower