serverFunctions.components (dev): server-functions client is duplicated when @solidjs/web is in optimizeDeps.exclude, so post-boot server components resolve to undefined
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 58/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript, vite
- 領域
- build-system, devtools
調査の方向性
Start with the command === 'serve' && serverComponents dependency entry in src/index.ts, then trace how @solidjs/web/frames and compiled function references resolve their server-functions client imports when @solidjs/web is excluded from optimizeDeps. Reproduce using the supplied Vite config and click sequence; the issue is done when the dynamically mounted panel renders with the exclusion enabled and the existing no-exclusion and build-preview behavior still works.
索引モデルが issue の本文から書いたものです。
説明
Versions: [email protected], @solidjs/[email protected], @solidjs/[email protected], [email protected] (first seen on rc.10 / next.46).
Repro
// vite.config.ts
export default defineConfig({
optimizeDeps: { exclude: ['@solidjs/web'] },
plugins: [solid({ ssr: true, start: { app: 'src/App.tsx' }, serverFunctions: { components: true } })],
})
// src/server.tsx
'use server'
export async function getPanel() {
return () => <section id="panel">server panel</section>
}
// src/App.tsx
export default function App() {
const [page, setPage] = createSignal('a')
const Panel = dynamic(() => getPanel())
return (
<>
<button id="go-b" onClick={() => setPage('b')}>go b</button>
{page() === 'a' ? <p id="page-a">page a</p> : <Loading><Panel /></Loading>}
</>
)
}
Run vite dev, load /, then click #go-b. The boundary is not in the document, so it mounts after boot.
Expected: the panel mounts, as it does without the exclude.
Actual: POST /_server/data/getPanel-… returns 200 application/x-frame-stream with the right chunks, but the call resolves to undefined and nothing mounts. A document-SSR'd (adopted) boundary still works, and vite build + vite preview work too.
Cause
With serverComponents, the plugin force-includes @solidjs/web/frames and @solidjs/web/server-functions (src/index.ts, the command === 'serve' && serverComponents entry) so that both share one instance of the transport config module. But @solidjs/web/frames imports @solidjs/web/server-functions/client. When the app excludes @solidjs/web, that subpath is neither included nor resolved to the optimized module:
node_modules/.vite/deps/@solidjs_web_frames.js→import … from "@solidjs/web/server-functions/client", which loads the raw node_modules file.- Compiled function references →
@solidjs/web/server-functions, which loads@solidjs_web_server-functions.js.
That gives two instances of the server-functions client. installServerComponents() calls configureServerFunctionsClient({ responseHandler }) on one of them, while the references call the other, which has no handler. The frame-stream response is therefore decoded as plain data.
Without the exclude, the frames bundle imports ./@solidjs_web_server-functions.js and everything shares one instance. Excluding @solidjs/web is common in apps that pin or link Solid.
Workaround
optimizeDeps: { exclude: ['@solidjs/web'], include: ['@solidjs/web/server-functions/client'] }
Suggested fix
When command === 'serve' && serverComponents, also force-include @solidjs/web/server-functions/client. Alternatively, have frames import the same specifier the references use.
- 主要言語
- TypeScript
- スター
- 522
- フォーク
- 73
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 35
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
solidjs/solid-vite-plugin のほかの issue
-
Test environment detection doesn't consider Vitest workspaces対応中かも @carloitaben が 57 日前に担当しました。 オープン1.x
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
solidjs/solid-vite-plugin#205 · コメント 1 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
solidjs/solid-vite-plugin#427 ·
メンテナーはふだん 1 日以内に返信
-
Dev: a stylesheet shared by the entry and a lazy component moves after the lazy component's stylesオープン
難易度 3/5 半日 初心者へのやさしさ 62/100
solidjs/solid-vite-plugin#425 ·
メンテナーはふだん 1 日以内に返信
-
[3.0.0-next.50 / next] SSR build: the $$moduleUrl export added to a Worker main module stops workerd from starting対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 3/5 半日 初心者へのやさしさ 55/100
solidjs/solid-vite-plugin#420 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
solidjs/solid-vite-plugin#419 ·
メンテナーはふだん 1 日以内に返信
solidjs/solid-vite-plugin の issue をすべて見る
似ている issue
-
bug priority: P2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
wayfinder:task
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
bug customer-reported data-plane question Service Attention Storage
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
Azure/azure-rest-api-specs#47397 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Claude thinking budget can shrink capped Haiku responses to 2,048 tokens対応中かも @DavyMassoneto が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
diegosouzapw/OmniRoute#17109 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
paperclipai/paperclip#16785 ·
メンテナーはふだん 1 日以内に返信