From 226d1599f319228fcf8d2632a84324129d9f19e0 Mon Sep 17 00:00:00 2001 From: Tiago Madeira Date: Tue, 9 Jan 2024 10:28:34 -0300 Subject: [PATCH] Upgrade nodejs (18.17.1 -> 18.19.0) The workaround to fix `structuredClone` type error in jest.config.js was found in https://github.com/zloirock/core-js/issues/1281 and came from https://github.com/elastic/kibana/commit/a5dbf26d8ddb59658c9697023b4d7bd55a0982b9 Change-Id: I18163a5b7fd0a25cc3d65b69d25499c32e8614ca GitOrigin-RevId: 19b1612b23f2dfb75f0fb6b8c3ab9a7323609bd1 --- .tool-versions | 2 +- platform/wab/Dockerfile | 2 +- platform/wab/jest.config.ts | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.tool-versions b/.tool-versions index 2ed955efa0a..4221dce8384 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -nodejs 18.17.1 +nodejs 18.19.0 python 3.10.13 diff --git a/platform/wab/Dockerfile b/platform/wab/Dockerfile index 64883eef6ec..58dd6823093 100644 --- a/platform/wab/Dockerfile +++ b/platform/wab/Dockerfile @@ -1,5 +1,5 @@ # Need newer alpine for bubblewrap to work -FROM node:18.17-alpine3.18 +FROM node:18.19-alpine3.18 # System setup RUN apk add --no-cache bash=5.2.15-r5 make=4.4.1-r1 bubblewrap=0.8.0-r1 git=2.40.1-r0 diff --git a/platform/wab/jest.config.ts b/platform/wab/jest.config.ts index a78896b22bf..1e0ed776076 100644 --- a/platform/wab/jest.config.ts +++ b/platform/wab/jest.config.ts @@ -59,6 +59,12 @@ const config: Config = { process.env.CI ? ["github-actions", { silent: false }] : "default", "summary", ], + // Workaround to "TypeError: Cannot assign to read only property + // 'structuredClone' of object '[object global]'", which started when + // upgrading node from 18.17.1 to 18.19.0. + globals: { + structuredClone: {}, + }, }; export default config;