You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug?]: 2.1.0 drops Vite's client resolve conditions, "browser" exports resolve to Node builds in the browser #2364
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.
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
pnpm dev and open /: the error overlay shows ReferenceError: process is not defined at env-probe/server.js:2:32.
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.
Activity