diff --git a/packages/api-client/src/socket/node.ts b/packages/api-client/src/socket/node.ts index c0f9db366e..5aac1f53d7 100644 --- a/packages/api-client/src/socket/node.ts +++ b/packages/api-client/src/socket/node.ts @@ -19,7 +19,12 @@ import { type ClientSocket, type ClientSocketFactory } from '@hcengineering/clie export const NodeWebSocketFactory: ClientSocketFactory = (url: string): ClientSocket => { // We need to override default factory with 'ws' one. // eslint-disable-next-line - const WebSocket = require('ws') + let WebSocket + try { + WebSocket = require('ws') + } catch (error) { + throw new Error('The "ws" package is required for NodeWebSocketFactory. ') + } type WebSocketData = Parameters[1] const ws = new WebSocket(url) diff --git a/services/gmail/pod-gmail/package.json b/services/gmail/pod-gmail/package.json index 5094f1af7e..8d408ca6cd 100644 --- a/services/gmail/pod-gmail/package.json +++ b/services/gmail/pod-gmail/package.json @@ -14,10 +14,10 @@ "build": "compile", "build:watch": "compile", "test": "jest --passWithNoTests --silent", - "_phase:bundle": "rushx bundle --external=ws", + "_phase:bundle": "rushx bundle", "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", - "bundle": "node ../../../common/scripts/esbuild.js --external=ws", + "bundle": "node ../../../common/scripts/esbuild.js", "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/gmail", "docker:tbuild": "docker build -t hardcoreeng/gmail . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/gmail", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/gmail staging",