Skip to content

[Bug?]: 2.1.0 drops Vite's client resolve conditions, "browser" exports resolve to Node builds in the browser #2364

Closed

Description

@jchatard

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

Since 2.1.0, the solid-start:config plugin sets resolve.conditions: ["generic"] in configEnvironment for every environment (#2326). Vite and vite-plugin-solid only add their default conditions when resolve.conditions is unset, so the client environment ends up with ["solid", "development", "generic"]: "module", "browser" and "development|production" are gone.

Any package with a "browser" export condition then resolves to its Node / default build in the browser, in dev and in production builds. For example @sentry/solidstart resolves to index.server.js → @sentry/node → ReferenceError: process is not defined.

Expected behavior 🤔

The client environment keeps Vite's default client conditions (["solid", "development", "module", "browser", "development|production"]), and "browser" exports are used in the browser, as in 2.0.x.

Steps to reproduce 🕹

Repro (create-solid basic template + a local package with the same export layout as @sentry/solidstart): https://github.com/jchatard/solid-start-client-conditions

Steps:

  1. pnpm install
  2. pnpm check: prints each environment's conditions and what the probe resolves to:
    [client] consumer=client
      resolve.conditions: [ 'solid', 'development', 'generic' ]
      env-probe → server.js
    ✗ BUG: the client environment does not resolve the "browser" export condition
    
  3. pnpm dev and open /: the error overlay shows ReferenceError: process is not defined at env-probe/server.js:2:32.
  4. pnpm build && grep -rl 'process.version' .output/public: the client bundle contains the Node build.

Context 🔦

We use @sentry/solidstart on a production SolidStart app: after upgrading to 2.1.0, Sentry's server SDK was bundled for the browser and crashed at startup. We currently work around it by appending defaultClientConditions back from a Vite plugin.

Restoring "browser" exposes a second issue, masked so far: the dev overlay imports @jridgewell/trace-mapping unbundled (solid packages are excluded from pre-bundling), and with "browser" it imports the UMD build of @jridgewell/resolve-uri. Any client error then breaks the overlay itself:

SyntaxError: The requested module '…/@jridgewell/resolve-uri/dist/resolve-uri.umd.js' does not provide an export named 'default'

I have a PR fixing both (client keeps Vite's defaults, servers keep "generic", trace-mapping pre-bundled in dev): #2365.

Your environment 🌎

System:
  OS: Linux 7.2.10 (CachyOS)
Binaries:
  Node: 24.15.0
  pnpm: 10.29.2
npmPackages:
  @solidjs/start: 2.1.0
  @solidjs/router: 1.0.0
  solid-js: 1.9.17
  vite: 8.3.5
  vite-plugin-solid: 2.11.14
  nitro: 3.0.260610-beta

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