Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,17 @@ The app opens a window and displays first-time setup. After completing setup, go

Make GUI changes in `ui/desktop`.

#### Troubleshooting: blank screen on `just run-ui`

If the app opens to a blank window (logs show `Cannot read properties of null (reading 'useRef')`), your `node_modules` is out of date and is loading two copies of React. Delete it and reinstall:

```
rm -rf ui/desktop/node_modules
cd ui && pnpm install
```

See #8757.

### Regenerating the OpenAPI schema

The file `ui/desktop/openapi.json` is automatically generated during the build.
Expand Down
9 changes: 0 additions & 9 deletions ui/desktop/vite.renderer.config.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { defineConfig } from 'vite';
import tailwindcss from '@tailwindcss/vite';
import { resolve } from 'path';

// https://vitejs.dev/config
export default defineConfig({
Expand All @@ -10,14 +9,6 @@ export default defineConfig({

plugins: [tailwindcss()],

resolve: {
dedupe: ['react', 'react-dom'],
Comment on lines -13 to -14

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lifeizhou-ap I think we can keep dedupe and just remove alias ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Abhijay007,

The above comment asks the same thing, I've replied to it above. TLDR: It does not hurt to add in, but it is unnecessary.

alias: {
react: resolve(__dirname, 'node_modules/react'),
'react-dom': resolve(__dirname, 'node_modules/react-dom'),
},
},

build: {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve React dedupe when removing aliases

With the resolve block removed entirely, the renderer no longer has resolve.dedupe for react/react-dom. In this pnpm workspace and for linked/local packages, Vite can resolve React from a dependency’s own node_modules, reintroducing the duplicate-React blank-window failure that the earlier fix(ui): dedupe React to prevent multiple instances in renderer commit was added to prevent. The hard-coded aliases can be removed, but the dedupe entries should remain so the renderer always uses one React instance.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under node-linker=hoisted there's a single hoisted React copy.

So dedupe is a no-op here; #8757's duplicate came from a stale node_modules, now covered CONTRIBUTING. Keeping dedupe would just be defensive

target: 'esnext'
},
Expand Down
Loading