From 8821642c79f6de204e69b477ef55f710243ecede Mon Sep 17 00:00:00 2001 From: Dinika Saxena Date: Thu, 7 Nov 2024 11:15:49 +0100 Subject: [PATCH] Upgrade to node 22 to fix react-pdf As suggested here the react-pdf workers use functions that are not availalbe on older node versions https://github.com/ai16z/eliza/issues/76 Signed-off-by: Dinika Saxena --- .nvmrc | 2 +- Dockerfile | 4 ++-- package.json | 2 +- .../AnalysisPlugin/__tests__/AnalysisPluginContainer.spec.tsx | 1 - vite.config.js | 4 ++-- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.nvmrc b/.nvmrc index 790e1105f..bb8c76c68 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v20.10.0 +v22.11.0 diff --git a/Dockerfile b/Dockerfile index e487c3eb9..65cd9599a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM timbru31/node-alpine-git:20 as builder +FROM timbru31/node-alpine-git:22 as builder WORKDIR /tmp/nexus-web COPY . /tmp/nexus-web @@ -13,7 +13,7 @@ RUN apk add --no-cache \ RUN yarn RUN NODE_OPTIONS=--max-old-space-size=8192 yarn build -FROM node:20-alpine +FROM node:22-alpine ENV NODE_ENV=production WORKDIR /opt/nexus COPY --from=builder /tmp/nexus-web/dist /opt/nexus/dist diff --git a/package.json b/package.json index a3aea9aff..72e15d9df 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "url": "https://github.com/BlueBrain/nexus/issues/new?labels=fusion", "type": "module", "engine": { - "node": "20.10.0", + "node": "22.11.0", "npm": ">=9.8.1", "yarn": "1.22.x" }, diff --git a/src/shared/containers/AnalysisPlugin/__tests__/AnalysisPluginContainer.spec.tsx b/src/shared/containers/AnalysisPlugin/__tests__/AnalysisPluginContainer.spec.tsx index 02627caae..e2f74c928 100644 --- a/src/shared/containers/AnalysisPlugin/__tests__/AnalysisPluginContainer.spec.tsx +++ b/src/shared/containers/AnalysisPlugin/__tests__/AnalysisPluginContainer.spec.tsx @@ -1,4 +1,3 @@ -import { vi } from 'vitest'; import { NexusProvider } from '@bbp/react-nexus'; import { createNexusClient } from '@bbp/nexus-sdk/es'; import { QueryClient, QueryClientProvider } from 'react-query'; diff --git a/vite.config.js b/vite.config.js index c304b5593..ea33b5aa8 100644 --- a/vite.config.js +++ b/vite.config.js @@ -23,7 +23,7 @@ export default defineConfig(() => { console.log('⛔️ describe may not getting the latest tag') } } - + return ({ base: process.env.NODE_ENV === 'production' ? "/__BASE__/" : "/", plugins: [ @@ -88,7 +88,7 @@ export default defineConfig(() => { output: { manualChunks: { lodash: ['lodash'], - pdfjs: ['node_modules/pdfjs-dist/build/pdf.worker.min.js'], + pdfjs: ['node_modules/pdfjs-dist/build/pdf.worker.min.mjs'], codemirror: ["codemirror", "react-codemirror2"] } }