Skip to content

Bug: View crashes with "workspacePages.map is not a function" when opening workspace #7757

Closed

Description

@mykolat

Where did this happen?

Desktop app (macOS)

Version

1.30.2 (1.30.2)

What happened?

Navigating to or selecting a workspace triggers a crash caught by the error boundary, rendering the main view unusable. The error message displayed is

This view hit an error
workspacePages.map is not a function

Steps to reproduce

Steps to reproduce*

  1. Open Superset desktop client v1.30.2 on macOS[cite: 1].
  2. Click on any existing workspace from the sidebar list (e.g., selecting a workspace item)[cite: 1].
  3. Observe the center view crashing into the error boundary displaying workspacePages.map is not a function.

Logs, screenshots, or recordings

No response

Activity

  1. github-actions commented on Sep 23, 2026

    @github-actions
    Contributor

    The cause looks like a server API change that broke released desktop builds, not a bug in the current client code. It should already be fixed on main by #7756, the latest commit (4c56a68). I'm writing up the findings now.

    Summary

    In desktop v1.30.2 on macOS, opening or selecting any workspace crashes the center view into the error boundary with workspacePages.map is not a function. The code points to a mismatch between the tRPC API and older released clients. The page.list procedure used to return a bare array of pages. A pagination change made it return { items, nextCursor } instead. v1.30.2 still calls page.list and runs .map(...) on the result, and .map doesn't exist on that object. The call happens in the workspace header's Pages menu, which mounts on every workspace view, so every workspace crashes.

    This is inferred from reading the code. I couldn't run anything, and I don't have the v1.30.2 source to confirm its exact call site.

    Affected code

    • Server, now: packages/trpc/src/router/page/page.ts:461-483. page.list takes the legacy input (legacyListPagesSchema, packages/trpc/src/router/page/schema.ts:125-131). It walks every batch through listPageBatch and returns one flat array. The comment on that schema says why: "Released desktop, mobile and CLI builds still call it and expect every page back as a bare array."
    • New paginated endpoint: packages/trpc/src/router/page/page.ts:485-493. page.listPaginated returns { items, nextCursor }, built in listPageBatch (page.ts:305-314).
    • Current desktop client: apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspacePagesMenu/WorkspacePagesMenu.tsx:62-94. It goes through usePagesList / page.listPaginated and passes .items into selectMenuPages({ workspacePages, ... }). selectMenuPages.ts:32-42 then calls workspacePages methods on it. The older client in 1.30.2 worked the same way but received the raw page.list result.

    Suspected root cause

    For some period the deployed API's page.list returned the paginated { items, nextCursor } object while v1.30.2 still expected an array. The client's workspacePages value was therefore an object, and calling .map on it threw. Commit 4c56a68 (#7756, "restore page.list's bare-array contract for released clients") brought back the array response for page.list and moved the paginated form to page.listPaginated.

    Reproduction

    1. Deploy the API from a commit before fix(pages): restore page.list's bare-array contract for released clients #7756.
    2. Point a v1.30.2 desktop build at that API.
    3. Open any workspace that has pages linked. The Pages menu in the header mounts and the view crashes.

    A bun:test / integration check, next to packages/trpc/src/router/page/list.integration.ts, to lock in the contract:

    test("page.list stays a bare array for released clients", async () => {
    	const result = await caller.page.list({ workspaceId });
    	expect(Array.isArray(result)).toBe(true);
    	const unscoped = await caller.page.list();
    	expect(Array.isArray(unscoped)).toBe(true);
    });

    Fix direction

    • Deploy: make sure the production API includes fix(pages): restore page.list's bare-array contract for released clients #7756. v1.30.2 should then recover without a client update. If reports keep coming after the deploy, the reporter should check whether it still happens once the API is updated.
    • Prevent a repeat: add the array-shape test above. Treat existing procedure output shapes as frozen once a client has shipped, and add a new procedure (as listPaginated now is) instead of changing an old one.
    • Access list: packages/trpc/src/lib/sandbox/api-credential.ts:35 lists "page.list". Someone should check whether page.listPaginated also needs to be there so sandbox and CLI callers on the new endpoint aren't rejected.
    • Client, optional: have the desktop pages hooks also accept an array response when reading pages (Array.isArray(data) ? data : data?.items ?? []). A future server or client version mismatch would then leave the menu empty instead of crashing the whole view.
  2. janss-en commented on Sep 23, 2026

    @janss-en

    Just got the error too :(

  3. ajays97 commented on Sep 23, 2026

    @ajays97

    Same crash issue in v1.30.1

  4. saddlepaddle commented on Sep 23, 2026

    @saddlepaddle
    Member

    This now should be fixed if you cmd+R, apologies for the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions