Skip to content

Tanstack Start + Solid Query + Nitro bug #6151

Closed

Description

@jcsmithf22

Which project does this relate to?

Start

Describe the bug

I started with a new Tanstack Start project, created with the cli, using Nitro and including Tanstack Query.

bun create @tanstack/start@latest --framework solid

To reproduce the bug, all I need to do is start the development server and go to http://localhost:3000/demo/tanstack-query (the Tanstack query demo route). If I navigate to this page via the navigation menu, I do not have an error. If I navigate to it using the search bar (or refresh the page), I get the following error:

Cannot read properties of undefined (reading 'defaultQueryOptions').

The issue seems to disappear if I remove nitro() from vite.config.ts, but I imagine that this is not a valid solution.

Your Example Website or App

https://github.com/jcsmithf22/tanstack-start-solid-query-reproduction

Steps to Reproduce the Bug or Issue

  1. Install dependencies with bun install
  2. Start development server with bun run dev
  3. Navigate to http://localhost:3000/demo/tanstack-query

Expected behavior

I expected to not receive this error at all, and to view the page as normal.

Screenshots or Videos

No response

Platform

  • Start Version: 1.141.7
  • Nitro Version: 3.0.1-alpha.1
  • OS: Windows (WSL Arch Linux)
  • Browser: Chrome
  • Browser Version: 143.0.7499.146
  • Bundler: Vite
  • Bundler Version: 7.3.0

Additional context

No response

Activity

  1. coderabbitai commented on Dec 19, 2025

    @coderabbitai
    Contributor

    📝 CodeRabbit Plan Mode

    Generate an implementation plan and prompts that you can use with your favorite coding agent.

    • Create Plan
    Examples

    🔗 Similar Issues

    Related Issues

    🔗 Related PRs

    #5816 - docs(solid-start): start-bun example [merged]
    #5847 - docs(solid-start): start-large example [merged]
    #5849 - docs(solid-start): start-tailwind-v4 [merged]

    👤 Suggested Assignees

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord or schedule a call!

  2. s3bba commented on Jan 16, 2026

    @s3bba

    I have the same error, and some additional context:
    When building for production, build with nitro works without issues.
    So for now as a bad workaround I have commented out the nitro plugin when running the dev server and not committing the changed file so CI still builds a production build with nitro.

  3. s3bba commented on Jan 19, 2026

    @s3bba

    I created a bit less horrible workaround that works for my setup

    export default defineConfig(({ command }) => {
      const isBuild = command === "build";
    
      return {
        // ... ,
        plugins: [
          // ... ,
          isBuild ? nitro() : undefined,
          // ... ,
        ].filter(Boolean) as PluginOption[],
        nitro: {},
      };
    });
  4. schiller-manuel commented on Jan 19, 2026

    @schiller-manuel
    Collaborator

    @s3bba are you using nitro-nightly?

    "nitro": "npm:nitro-nightly@latest"
  5. s3bba commented on Jan 19, 2026

    @s3bba

    @schiller-manuel Nope, nightly builds are broken for me, still figuring out why

    » bun run dev
    $ vite dev
    error when starting dev server:
    Error: Node env worker should be initialized before sending messages.
        at NodeEnvRunner.sendMessage (file:///home/sebba/work/s3bba/galerija/node_modules/.bun/nitro-nightly@3.0.1-20260119-145349-d0c4950f+405e1c4acb55b665/node_modules/nitro-nightly/dist/_chunks/dev.mjs:140:28)
        at new FetchableDevEnvironment (file:///home/sebba/work/s3bba/galerija/node_modules/.bun/nitro-nightly@3.0.1-20260119-145349-d0c4950f+405e1c4acb55b665/node_modules/nitro-nightly/dist/vite.mjs:168:18)
        at createFetchableDevEnvironment (file:///home/sebba/work/s3bba/galerija/node_modules/.bun/nitro-nightly@3.0.1-20260119-145349-d0c4950f+405e1c4acb55b665/node_modules/nitro-nightly/dist/vite.mjs:158:9)
        at Object.createEnvironment (file:///home/sebba/work/s3bba/galerija/node_modules/.bun/nitro-nightly@3.0.1-20260119-145349-d0c4950f+405e1c4acb55b665/node_modules/nitro-nightly/dist/vite.mjs:342:53)
        at file:///home/sebba/work/s3bba/galerija/node_modules/.bun/vite@7.3.1+9f2f6fe337f595d5/node_modules/vite/dist/node/chunks/config.js:25390:52
        at Array.map (<anonymous>)
        at _createServer (file:///home/sebba/work/s3bba/galerija/node_modules/.bun/vite@7.3.1+9f2f6fe337f595d5/node_modules/vite/dist/node/chunks/config.js:25389:58)
        at async CAC.<anonymous> (file:///home/sebba/work/s3bba/galerija/node_modules/.bun/vite@7.3.1+9f2f6fe337f595d5/node_modules/vite/dist/node/cli.js:572:18)
    error: script "dev" exited with code 1
    
  6. s3bba commented on Jan 19, 2026

    @s3bba

    Found the issue regarding this and the fix: nitrojs/nitro#3915 (comment)

    But, even with nitro nightly the error is still the same as before

  7. schiller-manuel commented on Jan 19, 2026

    @schiller-manuel
    Collaborator
  8. angeloanan commented on Apr 11, 2026

    @angeloanan

    Chiming in -- still can repro on latest template. For pnpm users, include the following in your pnpm-workspace.yaml as a fix / workaround:

    publicHoistPattern:
      - "nitro*"
  9. self-assigned this
    on Apr 26, 2026
  10. birkskyum commented on Apr 26, 2026

    @birkskyum
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions