Skip to content

TypeError in TanStack Start integration: Cannot read properties of undefined (reading 'has') in useStaticValueRef #490

@alexanderoskin

Description

@alexanderoskin

Bug Description

When using @apollo/client-integration-tanstack-start with server-side rendering, the application crashes with a TypeError in the useStaticValueRef function. The error occurs during renderToPipeableStream and prevents the page from rendering.

Error Message

Error in renderToPipeableStream: TypeError: Cannot read properties of undefined (reading 'has')
    at Object.useStaticValueRef (/project/sandbox/node_modules/.pnpm/@apollo+client-integration-tanstack-start@0.12.3-alpha.5_@apollo+client@3.13.8_@tanstack+reac_vwztb3tbdgqrge5w64pzauledq/node_modules/@apollo/client-integration-tanstack-start/src/ApolloProvider.tsx:82:7)
    at useTransportValue (/project/sandbox/node_modules/.pnpm/@apollo+client-react-streaming@0.12.3-alpha.5_@apollo+client@3.13.8_@types+react@19.1.8_graph_nbc2pd5h74exbuz2gad3urpa6u/node_modules/@apollo/client-react-streaming/src/DataTransportAbstraction/backpressuredCallback.ts:23:34)
    at <anonymous> (/project/sandbox/node_modules/.pnpm/@apollo+client-react-streaming@0.12.3-alpha.5_@apollo+client@3.13.8_@types+react@19.1.8_graph_nbc2pd5h74exbuz2gad3urpa6u/node_modules/@apollo/client-react-streaming/src/transportedQueryRef.ts:236:5)
    at useSuspenseQuery (/project/sandbox/node_modules/.pnpm/@apollo+client@3.13.8_@types+react@19.1.8_graphql@16.11.0_react-dom@19.1.0_react@19.1.0/node_modules/@apollo/src/react/hooks/useSuspenseQuery.ts:180:4)
    at Home (/project/sandbox/src/routes/index.tsx:23:20)
    at react-stack-bottom-frame (/project/sandbox/node_modules/.pnpm/react-dom@19.1.0_react@19.1.0/node_modules/react-dom/cjs/react-dom-server.node.development.js:9176:18)
    at renderWithHooks (/project/sandbox/node_modules/.pnpm/react-dom@19.1.0_react@19.1.0/node_modules/react-dom/cjs/react-dom-server.node.development.js:4797:19)
    at renderElement (/project/sandbox/node_modules/.pnpm/react-dom@19.1.0_react@19.1.0/node_modules/react-dom/cjs/react-dom-server.node.development.js:5232:23)
    at retryNode (/project/sandbox/node_modules/.pnpm/react-dom@19.1.0_react@19.1.0/node_modules/react-dom/cjs/react-dom-server.node.development.js:5991:31)
    at performWork (/project/sandbox/node_modules/.pnpm/react-dom@19.1.0_react@19.1.0/node_modules/react-dom/cjs/react-dom-server.node.development.js:6835:17) { componentStack: [Getter] }

Environment

  • Package version: @apollo/client-integration-tanstack-start@0.12.3-alpha.5
  • Apollo Client version: @apollo/client@3.13.8
  • React version: 19.1.0
  • TanStack Start: 1.129.8

Reproduction

A minimal reproduction case is available at: https://codesandbox.io/p/devbox/frosty-firefly-vjd7jy

Steps to Reproduce

  1. Set up a TanStack Start project with Apollo Client integration
  2. Use useSuspenseQuery in a component during SSR
  3. The error occurs during server-side rendering

Expected Behavior

The page should render successfully on the server without throwing a TypeError.

Actual Behavior

The application crashes with a TypeError when trying to access the has property of an undefined object in useStaticValueRef.

This appears to be a regression or compatibility issue with the current alpha version of the TanStack Start integration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions