Skip to content

About

Repro: solid-refresh (webpack mode) stops applying edits after a module's first evaluation threw

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

solid-refresh: webpack mode stops applying edits after a module's first evaluation threw

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:

  1. loads the page while src/Page.jsx throws at top level (JSON.parse('{')): index.jsx shows the error;
  2. fixes Page.jsx: Page.jsx does not accept the update itself, so index.jsx (which accepts ./Page.jsx) imports it again and renders v1;
  3. 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;

About

Repro: solid-refresh (webpack mode) stops applying edits after a module's first evaluation threw

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages