Skip to content

Commit fd2f55d

Browse files
committed
fix: add default resolve conditions to prevent server-side Svelte resolution
The `vite-plugin-solid` config hook sets `resolve.conditions` to `['solid', 'development']`, replacing Vite's defaults which include `browser` and `module`. Without `browser`, Svelte's package exports resolve to `index-server.js` instead of `index-client.js`, causing `mount(...)` to throw "not available on the server" in the browser. Add `['module', 'browser', 'development']` to the base Vite config so framework plugins append to these defaults rather than replacing them. https://claude.ai/code/session_01DyKgnqFPLT1z1z4ewaEtMT
1 parent 5b7a648 commit fd2f55d

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

packages/iles/src/client/app/components/Island.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ hydrate(framework, component, '${this.id}', ${serialize(props)}, ${serialize(slo
138138
139139
const ileRoot = h('ile-root', ileAttrs, prerenderIsland())
140140
141-
if (this.strategy === Hydrate.None)
141+
if (isSSR && this.strategy === Hydrate.None)
142142
return ileRoot
143143
144144
return [

packages/iles/src/node/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ function viteConfigDefaults (root: string, userConfig: UserConfig): ViteOptions
288288
root,
289289
resolve: {
290290
alias: resolveAliases(root, userConfig),
291+
conditions: ['module', 'browser', 'development'],
291292
dedupe: ['vue', 'vue-router', '@unhead/vue', '@vue/devtools-api'],
292293
},
293294
server: {

0 commit comments

Comments
 (0)