Skip to content

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

Closed

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.

Activity

  1. rnkdsh commented on Nov 1, 2025

    @rnkdsh

    same

  2. Aias commented on Nov 1, 2025

    @Aias

    Thanks for writing this up, affecting me too

  3. thanakit-p commented on Nov 1, 2025

    @thanakit-p

    I facing this problem too thanks.

  4. the10xProcrastinator commented on Nov 1, 2025

    @the10xProcrastinator

    Also getting this same error when importing TanStack Form in a TanStack start project:

    import { useForm } from '@tanstack/react-form'

    Using latest versions:

    • @tanstack/react-start 1.134.7
    • @tanstack/react-router 1.134.4
    • @tanstack/react-form 1.23.8

    Rolling back "@tanstack/react-start" from 1.134.7 --> 1.134.6 fixes the issue for me.

  5. bitpickle commented on Nov 2, 2025

    @bitpickle

    Same here!

  6. inaridiy commented on Nov 28, 2025

    @inaridiy

    Same here!

  7. inaridiy commented on Nov 28, 2025

    @inaridiy

    I was still facing this error in my environment.
    I suspect it might be related to pnpm workspace, though I'm not entirely sure about the root cause.
    As a quick workaround, I manually ran pnpm install use-sync-external-store and added import "use-sync-external-store" somewhere in my code. This resolved the error for me on the latest version.

  8. flyingduck92 commented on Jan 17, 2026

    @flyingduck92

    I have the same issue when using clerk

  9. dominictobias commented on Jan 28, 2026

    @dominictobias

    I have the same issue when using clerk

    Same. The other day Clerk was working though I don't remember seeing the error. Now it's not (SignInButton/SignUpButton do nothing on click). Is yours still working?

  10. wobsoriano commented on Jan 28, 2026

    @wobsoriano
    Contributor

    @flyingduck92 @dominictobias Are you still having issues with the Clerk TanStack SDK? Here's a temporary solution if you're still having issues with use-sync-external-store.

    SignInButton/SignUpButton do nothing on click

    @dominictobias Are you seeing any console errors? I'm guessing you don't have a sign in and sign up page configured

  11. flyingduck92 commented on Jan 29, 2026

    @flyingduck92

    @wobsoriano I fixed it by not following the official docs, but the github quick start project at https://github.com/clerk/clerk-tanstack-react-start-quickstart/
    the vite.config setup should be mentioned on the official docs and the github project starter, but there is no mention on official docs about vite.config setup

  12. ConanMcN commented on Mar 2, 2026

    @ConanMcN

    @wobsoriano I fixed it by not following the official docs, but the github quick start project at https://github.com/clerk/clerk-tanstack-react-start-quickstart/ the vite.config setup should be mentioned on the official docs and the github project starter, but there is no mention on official docs about vite.config setup

    Thanks, this fixed it for me!

  13. flyingduck92 commented on Mar 3, 2026

    @flyingduck92

    @ConanMcN Glad It helps. Happy coding sir

  14. sleeyax commented on Mar 4, 2026

    @sleeyax

    Also getting this same error when importing TanStack Form in a TanStack start project:

    import { useForm } from '@tanstack/react-form'

    Using latest versions:

    * @tanstack/react-start 1.134.7
    
    * @tanstack/react-router 1.134.4
    
    * @tanstack/react-form 1.23.8
    

    Rolling back "@tanstack/react-start" from 1.134.7 --> 1.134.6 fixes the issue for me.

    I'm experiencing this issue as well on:

        "@tanstack/react-form-start": "^1.28.3",
        "@tanstack/react-router": "^1.163.2",
        "@tanstack/react-start": "^1.163.2",
    

    I got it working by adding the following to vite.config.ts. This is based on the changes introduced in #5726.

     optimizeDeps: {
        include: ["@tanstack/react-form-start"],
      },
  15. wobsoriano commented on Mar 4, 2026

    @wobsoriano
    Contributor

    FYI @flyingduck92 @ConanMcN @dominictobias we released Clerk Core 3 which includes the migration from swr to @tanstack/react-query meaning this error is gone.

  16. sithu-khant commented on Jun 25, 2026

    @sithu-khant

    Also getting this same error when importing TanStack Form in a TanStack start project:
    import { useForm } from '@tanstack/react-form'
    Using latest versions:

    * @tanstack/react-start 1.134.7
    
    * @tanstack/react-router 1.134.4
    
    * @tanstack/react-form 1.23.8
    

    Rolling back "@tanstack/react-start" from 1.134.7 --> 1.134.6 fixes the issue for me.

    I'm experiencing this issue as well on:

        "@tanstack/react-form-start": "^1.28.3",
        "@tanstack/react-router": "^1.163.2",
        "@tanstack/react-start": "^1.163.2",
    

    I got it working by adding the following to vite.config.ts. This is based on the changes introduced in #5726.

    optimizeDeps: {
    include: ["@tanstack/react-form-start"],
    },

    This works for me.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions