Skip to content

bug: framework agnostic createXXX compilation is not transformed #6583

Description

@juliusmarminge

Which project does this relate to?

Start

Describe the bug

When 3rd party packages tries to be framework agnostic and import from the core packages, the compiler that transforms stub functions does not apply. For example, in Tanstack Themes, I do import { createClientOnlyFn, createIsomorphicFn } from "@tanstack/start-client-core"; to create isomorphic functions (see https://github.com/juliusmarminge/tanstack-themes/blob/5738fe70e7ce344b36b08fc86e46a2217c3f64ef/packages/core/src/index.ts#L112-L128), but when these run we get errors:

Error executing head for route __root__: TypeError: (0 , __vite_ssr_import_4__.getThemeColorMetaTags) is not a function or its return value is not iterable
    at Object.head (/home/projects/wmaioxmyxy.github/src/routes/__root.tsx:17:62)
    at executeHead (file:///home/projects/wmaioxmyxy.github/node_modules/@tanstack/router-core/dist/esm/load-matches.js:360:25)
    at Module.loadMatches (file:///home/projects/wmaioxmyxy.github/node_modules/@tanstack/router-core/dist/esm/load-matches.js:600:28)
    at async eval (file:///home/projects/wmaioxmyxy.github/node_modules/@tanstack/router-core/dist/esm/router.js:751:13)

Your Example Website or App

https://stackblitz.com/edit/github-bfs5kckh?file=src%2Froutes%2F__root.tsx

Steps to Reproduce the Bug or Issue

  1. npm i
  2. npm run dev
  3. See error

Expected behavior

It to work same as if the import was from @tanstack/react-start

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.157.18
  • OS: macOS
  • Browser: Helium
  • Browser Version 0.8.4.1 (Official Build, Chromium 144.0.7559.109) (arm64)
  • Bundler: Vite
  • Bundler Version: 7.3.1

Additional context

No response

Activity

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