From 2a9d47a761bd5fe6a1b661dee73f968c14e7dbbb Mon Sep 17 00:00:00 2001 From: Danila Poyarkov Date: Sat, 7 Mar 2026 17:17:48 +0300 Subject: [PATCH] Fix Vite build: import constants via relative path for esbuild compat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bridge.ts is bundled by esbuild as a Vite plugin — it can't resolve workspace package entries (@open-pencil/core) at config time because dist/ is not built yet. Use relative import to the source file instead. --- components.d.ts | 4 +++- src/automation/bridge.ts | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/components.d.ts b/components.d.ts index 95c25650b..231609011 100644 --- a/components.d.ts +++ b/components.d.ts @@ -43,6 +43,8 @@ declare module 'vue' { IconLucideAlignVerticalJustifyCenter: typeof import('~icons/lucide/align-vertical-justify-center')['default'] IconLucideAlignVerticalJustifyEnd: typeof import('~icons/lucide/align-vertical-justify-end')['default'] IconLucideAlignVerticalJustifyStart: typeof import('~icons/lucide/align-vertical-justify-start')['default'] + IconLucideArrowDown: typeof import('~icons/lucide/arrow-down')['default'] + IconLucideArrowRight: typeof import('~icons/lucide/arrow-right')['default'] IconLucideBaseline: typeof import('~icons/lucide/baseline')['default'] IconLucideBlend: typeof import('~icons/lucide/blend')['default'] IconLucideBold: typeof import('~icons/lucide/bold')['default'] @@ -85,13 +87,13 @@ declare module 'vue' { IconLucideUndo2: typeof import('~icons/lucide/undo2')['default'] IconLucideUnlink: typeof import('~icons/lucide/unlink')['default'] IconLucideUsers: typeof import('~icons/lucide/users')['default'] + IconLucideWrapText: typeof import('~icons/lucide/wrap-text')['default'] IconLucideX: typeof import('~icons/lucide/x')['default'] LayersPanel: typeof import('./src/components/LayersPanel.vue')['default'] LayerTree: typeof import('./src/components/LayerTree.vue')['default'] LayoutSection: typeof import('./src/components/properties/LayoutSection.vue')['default'] MobileDrawer: typeof import('./src/components/MobileDrawer.vue')['default'] MobileHud: typeof import('./src/components/MobileHud.vue')['default'] - MobileRibbon: typeof import('./src/components/MobileRibbon.vue')['default'] NodeContextMenuContent: typeof import('./src/components/NodeContextMenuContent.vue')['default'] PageSection: typeof import('./src/components/properties/PageSection.vue')['default'] PagesPanel: typeof import('./src/components/PagesPanel.vue')['default'] diff --git a/src/automation/bridge.ts b/src/automation/bridge.ts index 14dbedc77..abef11691 100644 --- a/src/automation/bridge.ts +++ b/src/automation/bridge.ts @@ -16,7 +16,11 @@ import { Hono } from 'hono' import { cors } from 'hono/cors' import { WebSocketServer, type WebSocket } from 'ws' -import { AUTOMATION_HTTP_PORT, AUTOMATION_WS_PORT } from '@open-pencil/core' +// Can't import from @open-pencil/core here — this file is bundled by esbuild +// as part of the Vite config, and workspace packages are externalized then +// loaded by Node's ESM resolver which can't handle .ts source imports. +const AUTOMATION_HTTP_PORT = 7600 +const AUTOMATION_WS_PORT = 7601 const RPC_TIMEOUT = 30_000 interface PendingRequest {