Skip to content

Intermittent Vite import resolution error with caller-factory--server-context #78

Description

@m7md1alaa

I occasionally encounter the following error when using caller-factory--server-context with TanStack Start:

[plugin:vite:import-analysis] Failed to resolve import "tanstack-start-injected-head-scripts:v" 
from "node_modules/@tanstack/start-server-core/dist/esm/router-manifest.js?v=04e4edb2". 
Does the file exist?

Environment

  • TanStack Start: 1.132.0
  • Vite: ^7.1.7

problem in this file i copied from caller-factory--server-context

Workaround

i tried to add "use server"; at the top of the file below seems to resolve the issue:

src/lib/convex/server.server.ts

My assumption is that the module is sometimes being treated as a client module which causes Vite to attempt resolving server-only injected imports

Documentation Feedback

There are also a few points that were unclear during setup:

  • Some steps are either not documented or appear in locations that were not obvious.

Overall, the library is sooo excellent and the developer experience is promising. Thanks for the work on this project

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