Skip to content

@tanstack/react-start v1.134.7 causes import error with use-sync-external-store #5717

@EthanShoeDev

Description

@EthanShoeDev

Which project does this relate to?

Start

Describe the bug

When I upgrade to to v1.134.7 of @tanstack/react-start, I get a runtime error if I view a react component that imports tanstack-store. I personally triggered this by using tanstack-form which uses store underneath.

tanstack-store uses use-sync-external-store which is only published as cjs.

I was able to replicate this by cloning the start-basic template and adding tanstack forms.

The issue goes away when I switch to "@tanstack/react-start": "1.134.6",

Specifically this commit

Your Example Website or App

https://github.com/EthanShoeDev/import-bug-repro-tanstack-start

Steps to Reproduce the Bug or Issue

  1. Clone the start-basic template
  2. Add tanstack-forms
  3. Add any form to any route and view that route.

Expected behavior

The module loads correctly

Screenshots or Videos

Image

Platform

  • Router / Start Version: [e.g. 1.121.0]
  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Browser Version: [e.g. 91.1]
  • Bundler: [e.g. vite]
  • Bundler Version: [e.g. 7.0.0]

Additional context

Browser console logs:

hook.js:608 SyntaxError: The requested module '/node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.0/node_modules/use-sync-external-store/shim/with-selector.js?v=d9f62913' does not provide an export named 'useSyncExternalStoreWithSelector' (at index.js?v=d9f62913:1:10)

The above error occurred in the <Lazy> component.

React will try to recreate this component tree from scratch using the error boundary you provided, CatchBoundaryImpl.

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