Repro for solidjs/solid-refresh: solidjs/solid-refresh#88 (comment).
webpack 5 + webpack-dev-server + babel-loader + solid-refresh/babel (bundler: "webpack5"), solid-js 1.9.
npm install
npm run repro # solid-refresh as published
npm run control # same, with the one-line fix applied (aliased copy of the dist; node_modules is not modified)Uses Playwright's Chromium (npx playwright install chromium), or set CHROME_PATH.
repro.mjs starts the dev server and a browser, then:
- loads the page while
src/Page.jsxthrows at top level (JSON.parse('{')):index.jsxshows the error; - fixes
Page.jsx:Page.jsxdoes not accept the update itself, soindex.jsx(which accepts./Page.jsx) imports it again and rendersv1; - edits
Page.jsx(v1→v2).
$ npm run repro
solid-refresh 0.7.8
1. load, Page.jsx throws: error shown
2. fix: v1 shown
3. edit v1 -> v2: v2 NOT shown (page: "v1")
page loads: 1; Page.jsx evaluations: v1 (throws), v1, v2
RESULT: edit not applied
$ npm run control
solid-refresh 0.7.8 + fix
1. load, Page.jsx throws: error shown
2. fix: v1 shown
3. edit v1 -> v2: v2 shown
page loads: 1; Page.jsx evaluations: v1 (throws), v1, v2
RESULT: OK
The fix (control), in $$refreshStandard:
-data[SOLID_REFRESH] = current ? current[SOLID_REFRESH] : registry;
+data[SOLID_REFRESH] = current?.[SOLID_REFRESH] ?? registry;