codepod-io / codepod

Codepod IDE: Scalable Interactive Coding
https://codepod.io
MIT License
71 stars 16 forks source link

UI-web container crash #522

Closed senwang86 closed 11 months ago

senwang86 commented 11 months ago

Error log

`

ui-web@0.0.0 dev /codepod/apps/ui-web vite --host

VITE v4.4.5 ready in 1030 ms

➜ Local: http://localhost:3000/ ➜ Network: http://192.168.247.7:3000/ ✘ [ERROR] Could not resolve "yjs"

../../node_modules/.pnpm/y-protocols@1.0.5/node_modules/y-protocols/auth.js:2:19:
  2 │ import * as Y from 'yjs' // eslint-disable-line
    ╵                    ~~~~~

You can mark the path "yjs" as external to exclude it from the bundle, which will remove this error.

✘ [ERROR] Could not resolve "yjs"

../../node_modules/.pnpm/y-protocols@1.0.5/node_modules/y-protocols/sync.js:7:19:
  7 │ import * as Y from 'yjs'
    ╵                    ~~~~~

You can mark the path "yjs" as external to exclude it from the bundle, which will remove this error.

/codepod/node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1649 let error = new Error(${text}${summary}); ^

Error: Build failed with 2 errors: ../../node_modules/.pnpm/y-protocols@1.0.5/node_modules/y-protocols/auth.js:2:19: ERROR: Could not resolve "yjs" ../../node_modules/.pnpm/y-protocols@1.0.5/node_modules/y-protocols/sync.js:7:19: ERROR: Could not resolve "yjs" at failureErrorWithLog (/codepod/node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1649:15) at /codepod/node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1058:25 at /codepod/node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1525:9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { errors: [ { detail: undefined, id: '', location: { column: 19, file: '../../node_modules/.pnpm/y-protocols@1.0.5/node_modules/y-protocols/auth.js', length: 5, line: 2, lineText: "import as Y from 'yjs' // eslint-disable-line", namespace: '', suggestion: '' }, notes: [ { location: null, text: 'You can mark the path "yjs" as external to exclude it from the bundle, which will remove this error.' } ], pluginName: '', text: 'Could not resolve "yjs"' }, { detail: undefined, id: '', location: { column: 19, file: '../../node_modules/.pnpm/y-protocols@1.0.5/node_modules/y-protocols/sync.js', length: 5, line: 7, lineText: "import as Y from 'yjs'", namespace: '', suggestion: '' }, notes: [ { location: null, text: 'You can mark the path "yjs" as external to exclude it from the bundle, which will remove this error.' } ], pluginName: '', text: 'Could not resolve "yjs"' } ], warnings: [] }

Node.js v18.17.1  ELIFECYCLE  Command failed with exit code 1. `

lihebi commented 11 months ago

Try:

docker compose up -d —force-recreate

senwang86 commented 11 months ago

I ran docker-compose up -d --force-recreate and the 'yjs' path issue is gone. http://localhost:3000/ is reachable with 3 other complains:

` ERROR(TypeScript) JSX element class does not support attributes because it does not have a 'props' property. FILE /codepod/apps/ui-web/src/App.tsx:136:9

134 |     <ThemeProvider theme={theme}>
135 |       <AuthProvider apiUrl={apiUrl} spawnerApiUrl={spawnerApiUrl}>

136 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 137 | 138 | 139 |

ERROR(TypeScript) 'SnackbarProvider' cannot be used as a JSX component. Its type 'typeof SnackbarProvider' is not a valid JSX element type. Type 'typeof SnackbarProvider' is not assignable to type 'new (props: any, deprecatedLegacyContext?: any) => Component<any, any, any>'. Type 'SnackbarProvider' is missing the following properties from type 'Component<any, any, any>': context, setState, forceUpdate, props, and 2 more. FILE /codepod/apps/ui-web/src/App.tsx:136:10

134 |     <ThemeProvider theme={theme}>
135 |       <AuthProvider apiUrl={apiUrl} spawnerApiUrl={spawnerApiUrl}>

136 | | ^^^^^^^^^^^^^^^^ 137 | 138 | 139 |

ERROR(TypeScript) Property 'navigator' does not exist on type 'unknown'. FILE /codepod/apps/ui/src/lib/prompt.tsx:16:11

14 |
15 | function useConfirmExit(confirmExit, when = true) {

16 | const { navigator } = useContext(NavigationContext); | ^^^^^^^^^ 17 | 18 | useEffect(() => { 19 | if (!when) {

[TypeScript] Found 3 errors. Watching for file changes. `

lihebi commented 11 months ago

3 other complains:

Do you still get these errors? I couldn't reproduce.

senwang86 commented 11 months ago

3 other complains:

Do you still get these errors? I couldn't reproduce.

The 3 complains are gone after I create a new branch, weird.

lihebi commented 11 months ago

I find that sometimes Vite cannot pick up changes and need to restart the container if you get weird behaviors.