Skip to content

Dev server broken with @tanstack/solid-start and @cloudflare/vite-plugin #5291

Closed

Description

@jakst

Which project does this relate to?

Start

Describe the bug

After setting up the Cloudflare plugin on a @tanstack/solid-start project, the dev server gives this error on start:

error when starting dev server:
Error: The following environment options are incompatible with the Cloudflare Vite plugin:
        - "ssr" environment: `resolve.external`: ["@solid-primitives/refs","tiny-invariant","@tanstack/history","@solid-devtools/logger","@tanstack/router-core","tiny-warning","isbot","@tanstack/store"]
To resolve this issue, avoid setting `resolve.external` in your Cloudflare Worker environments.

    at validateWorkerEnvironmentOptions (file:///Users/jakst/code/tmp/solid-start-solid-rc-broken/node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]/node_modules/@cloudflare/vite-plugin/dist/index.js:17244:11)
    at BasicMinimalPluginContext.configResolved (file:///Users/jakst/code/tmp/solid-start-solid-rc-broken/node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]/node_modules/@cloudflare/vite-plugin/dist/index.js:17373:11)
    at file:///Users/jakst/code/tmp/solid-start-solid-rc-broken/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-Bm2ujbhY.js:35994:87
    at Array.map (<anonymous>)
    at resolveConfig (file:///Users/jakst/code/tmp/solid-start-solid-rc-broken/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-Bm2ujbhY.js:35994:68)
    at async _createServer (file:///Users/jakst/code/tmp/solid-start-solid-rc-broken/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-Bm2ujbhY.js:28008:67)
    at async CAC.<anonymous> (file:///Users/jakst/code/tmp/solid-start-solid-rc-broken/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/cli.js:573:18)
 ELIFECYCLE  Command failed with exit code 1.

Running pnpm vite build && pnpm wrangler dev or pnpm vite preview, works as expected.

Note that I haven't tried any of the actual integrations with Cloudflare. This is just for getting it running.

Your Example Website or App

https://github.com/jakst/solid-start-solid-rc-broken/tree/cloudflare-broken

Steps to Reproduce the Bug or Issue

  1. Clone the repo
  2. Make sure you are on the cloudflare-broken branch
  3. Install deps
  4. Run pnpm dev. You should get the error message from above.

Expected behavior

I expect the dev server to work when using the Cloudflare Vite plugin with Tanstack Solid Start.

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.132.23/1.132.24
  • OS: MacOs v15.6.1
  • Browser: Chrome
  • Browser Version: v140
  • Bundler: Vite
  • Bundler Version: 7.1.7

Additional context

No response

Activity

  1. schiller-manuel commented on Sep 29, 2025

    @schiller-manuel
    Collaborator

    reported upstream issue

  2. HoaX7 commented on Oct 2, 2025

    @HoaX7

    @jakst can you share your vite.config.ts? Im facing same issue even with the workaround. I keep getting this error getContextId cannot be used under non-hydrating context with tanstack start + solid + cloudflare. This only happens in dev.

  3. HoaX7 commented on Oct 2, 2025

    @HoaX7

    @schiller-manuel any insights?

  4. jakst commented on Oct 2, 2025

    @jakst
    ContributorAuthor

    @HoaX7 I used the workaround that someone commented on Manuel's upstream issue.

    Add this to the vite plugin list

    plugins: [
      {
        // Workaround for https://github.com/solidjs/vite-plugin-solid/issues/232
        name: "remove-ssr-external",
        configResolved(config) {
          if (config.environments.ssr)
            config.environments.ssr.resolve.external = [];
        },
      },
      // ...
    ]
  5. HoaX7 commented on Oct 2, 2025

    @HoaX7

    @jakst I used this workaround too but then ran into other issues. Were you able to run everything locally in dev? I pulled your code and tried it myself and ran into issues.
    I created an issue #5338 explaining the bug

  6. jakst commented on Oct 2, 2025

    @jakst
    ContributorAuthor

    Interesting. You're right, that issue is there on my reproduction. I'm not getting it on our main application, which is where I used the workaround. I wonder why I'm not seeing it there 🤔

  7. HoaX7 commented on Oct 2, 2025

    @HoaX7

    maybe you have a different config? can you help me with the plumbing if you dont mind. otherwise im thinking of moving to solid start haha until tanstack is more stable

  8. jakst commented on Oct 2, 2025

    @jakst
    ContributorAuthor

    I might be able too look into what makes the difference in a bit, but until then, I'd recommend just going with v1.131.x. It works great for us for now. We had a bunch of issues with solid-start with Cloudflare as well, so I wouldn't count on that path being smooth sailing either. They're also ditching vinxi in a bit which is bound to create some more breakage.

  9. HoaX7 commented on Oct 2, 2025

    @HoaX7

    Thanks! Appreciate it

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