From 3ab7f9f668c31f57cb74509aba53c7ac9aee1ec5 Mon Sep 17 00:00:00 2001 From: Liad Yosef Date: Thu, 27 Jun 2024 14:24:36 -0400 Subject: [PATCH 1/2] fix(requireFn): stub Node's tty module --- .../es-modules/package-manager/built-in-dependencies-list.ts | 3 +++ editor/src/core/tailwind/tailwind.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/editor/src/core/es-modules/package-manager/built-in-dependencies-list.ts b/editor/src/core/es-modules/package-manager/built-in-dependencies-list.ts index fc28d5e48bb5..62e45a8c0d1c 100644 --- a/editor/src/core/es-modules/package-manager/built-in-dependencies-list.ts +++ b/editor/src/core/es-modules/package-manager/built-in-dependencies-list.ts @@ -8,6 +8,7 @@ import * as ReactDOM from 'react-dom' import * as ReactRouter from 'react-router' import * as ReactJsxRuntime from 'react/jsx-runtime' import * as UtopiaAPI from 'utopia-api' +import * as TTYStub from './node-builtin-shims/tty-stub' import * as UUIUI from '../../../uuiui' import * as UUIUIDeps from '../../../uuiui-deps' import * as RemixServerBuild from './built-in-third-party-dependencies/remix-server-build' @@ -121,5 +122,7 @@ export function createBuiltInDependenciesList( builtInDependency('@remix-run/eslint-config', Stub, '2.1.0'), builtInDependency('@shopify/cli', Stub, '3.50.0'), builtInDependency('@shopify/cli-hydrogen', Stub, '6.0.0'), + // Node builtins + builtInDependency('tty', TTYStub, '*'), ] } diff --git a/editor/src/core/tailwind/tailwind.ts b/editor/src/core/tailwind/tailwind.ts index 77377a196ad7..e6f348483c79 100644 --- a/editor/src/core/tailwind/tailwind.ts +++ b/editor/src/core/tailwind/tailwind.ts @@ -124,6 +124,7 @@ function getTailwindConfig( return left('Tailwind config contains no default export') } } catch (error) { + console.error('Error loading tailwind config', error) return left(error) } } From 7bf486e63599a105ad1685ddcd04830d16ded62d Mon Sep 17 00:00:00 2001 From: Liad Yosef Date: Thu, 27 Jun 2024 14:27:11 -0400 Subject: [PATCH 2/2] add tty stub --- .../package-manager/node-builtin-shims/tty-stub.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 editor/src/core/es-modules/package-manager/node-builtin-shims/tty-stub.ts diff --git a/editor/src/core/es-modules/package-manager/node-builtin-shims/tty-stub.ts b/editor/src/core/es-modules/package-manager/node-builtin-shims/tty-stub.ts new file mode 100644 index 000000000000..98936f70d7e8 --- /dev/null +++ b/editor/src/core/es-modules/package-manager/node-builtin-shims/tty-stub.ts @@ -0,0 +1,9 @@ +export const isatty = () => false + +export function ReadStream() { + throw new Error('tty.ReadStream is not implemented') +} + +export function WriteStream() { + throw new Error('tty.WriteStream is not implemented') +}