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
5 changes: 5 additions & 0 deletions .changeset/legal-poems-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@workflow/web-shared": patch
---

Set `"type": "module"` in package.json
5 changes: 5 additions & 0 deletions .changeset/shiny-pens-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@workflow/web": patch
---

Fix "dev" mode
1 change: 1 addition & 0 deletions packages/web-shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"access": "public"
},
"license": "Apache-2.0",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
Expand Down
12 changes: 8 additions & 4 deletions packages/web/app/lib/workflow-api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,12 @@ export function useWorkflowRuns(
]);
const [maxPagesVisited, setMaxPagesVisited] = useState(1);

// Store PageResult for each page
// Store PageResult for each page.
// Initial isLoading is false so SSR and client hydration agree; after mount,
// the useEffect that triggers the first fetch will set it to true on the client.
const [allPageResults, setAllPageResults] = useState<
Map<number, PageResult<WorkflowRun>>
>(new Map([[0, { data: null, isLoading: true, error: null }]]));
>(new Map([[0, { data: null, isLoading: false, error: null }]]));

// Cache for fetched pages - key is cursor (or 'initial' for first page)
const pageCache = useRef<
Expand Down Expand Up @@ -412,10 +414,12 @@ export function useWorkflowHooks(
]);
const [maxPagesVisited, setMaxPagesVisited] = useState(1);

// Store PageResult for each page
// Store PageResult for each page.
// Initial isLoading is false so SSR and client hydration agree; after mount
// the useEffect that triggers the first fetch will set it to true on the client.
const [allPageResults, setAllPageResults] = useState<
Map<number, PageResult<Hook>>
>(new Map([[0, { data: null, isLoading: true, error: null }]]));
>(new Map([[0, { data: null, isLoading: false, error: null }]]));

// Cache for fetched pages - key is cursor (or 'initial' for first page)
const pageCache = useRef<
Expand Down
21 changes: 14 additions & 7 deletions packages/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@ export default defineConfig(({ command, isSsrBuild }) => ({
// can be installed and run without needing any of the UI dependencies
// (Radix, lucide-react, etc.) at runtime. Only Node.js built-ins and
// express (needed by server.js) remain external.
ssr:
command === 'build' && isSsrBuild
? {
noExternal: true,
external: ['express'],
}
: undefined,
//
// During dev (`react-router dev`), Vite's SSR module runner evaluates
// modules using its ESM evaluator which cannot handle CJS packages
// (they fail with "module/exports is not defined"). We disable
// noExternal for dev so dependencies are loaded natively by Node.js.
ssr: {
noExternal: command === 'build' ? true : undefined,
external: ['express'],
},
plugins: [tailwindcss(), reactRouter()],
resolve: {
// Ensure all workspace packages resolve React from the same location
// to prevent duplicate React instances (which cause "Invalid hook call"
// errors). This is necessary during dev when noExternal is not set and
// linked workspace packages might resolve their own copy of React.
dedupe: ['react', 'react-dom'],
alias: [{ find: '~', replacement: '/app' }],
},
}));
Loading