Symptoms
When the dev server is running, a large bulk edit to a high-fanout module, for example packages/ui/src/components/icon.tsx, can leave some components detached from their context providers during HMR. The browser then reports errors such as:
Error: Layout context must be used within a context provider
at use (packages/ui/src/context/helper.tsx:37)
at DialogSelectFile2 (packages/app/src/components/dialog-select-file.tsx:197)
at HMRComp.createMemo.name (@solid-refresh:25)
The same branch previously reproduced a similar useGlobalSync must be used within GlobalSyncProvider error. The failing provider changed, but the symptom pattern was the same.
Reproduction
- Run
bun dev:desktop.
- Make a large bulk edit to
packages/ui/src/components/icon.tsx, for example replacing 70+ SVG entries in one change.
- Open a page that triggers a dialog, overlay, or similar re-render.
Current Workaround
Stop the dev server with Ctrl+C, then restart it with bun dev:desktop. A cold restart immediately recovers the app.
This appears to affect only the development loop. Production builds and typecheck still pass.
Suspected Cause
@solid-refresh may recreate referenced components after a large module-level constant change, while the parent provider instance is not re-wired correctly. App-root providers under packages/app/src/context/* should not be affected by a leaf icon module edit, but they appear to become detached through HMR.
Expected Behavior
The dev server should not lose app-root context providers after a leaf or high-fanout UI module changes.
If this is a Solid HMR limitation, a development-only full reload or dev overlay warning would be acceptable.
Priority
P3. This does not affect production, but it can disrupt the development loop during large UI refactors.
Symptoms
When the dev server is running, a large bulk edit to a high-fanout module, for example
packages/ui/src/components/icon.tsx, can leave some components detached from their context providers during HMR. The browser then reports errors such as:The same branch previously reproduced a similar
useGlobalSync must be used within GlobalSyncProvidererror. The failing provider changed, but the symptom pattern was the same.Reproduction
bun dev:desktop.packages/ui/src/components/icon.tsx, for example replacing 70+ SVG entries in one change.Current Workaround
Stop the dev server with
Ctrl+C, then restart it withbun dev:desktop. A cold restart immediately recovers the app.This appears to affect only the development loop. Production builds and typecheck still pass.
Suspected Cause
@solid-refreshmay recreate referenced components after a large module-level constant change, while the parent provider instance is not re-wired correctly. App-root providers underpackages/app/src/context/*should not be affected by a leaf icon module edit, but they appear to become detached through HMR.Expected Behavior
The dev server should not lose app-root context providers after a leaf or high-fanout UI module changes.
If this is a Solid HMR limitation, a development-only full reload or dev overlay warning would be acceptable.
Priority
P3. This does not affect production, but it can disrupt the development loop during large UI refactors.