HMR becoming less and less reliable as project size grows

Originally the HMR worked very well however as my project has grown in size (over 100 files) it has become less reliable. According to the dev server it is repackaging the extension when I save. However when I then reload the page for the content script those changes are not there. Instead I have to restart the dev server to see the new changes.
1 Reply
Pattison
Pattison•2mo ago
On further investigation it may not be the HMR that I am having a problem with, as from what I can see that has never been working as I always get:
WebSocket connection to 'ws://localhost:1815/' failed:
T @ ui.b851b4e2.js:213
2jjbS @ ui.b851b4e2.js:351
newRequire @ ui.b851b4e2.js:72
(anonymous) @ ui.b851b4e2.js:123
(anonymous) @ ui.b851b4e2.js:146
(anonymous) @ ui.b851b4e2.js:564257
Show 6 more frames
Show less
ui.b851b4e2.js:151 🟠 WARN | [plasmo/parcel-runtime]: Connection to the HMR server is closed for /Users/*/GolandProjects/*/*/.plasmo/static/contents/ui.tsx
WebSocket connection to 'ws://localhost:1815/' failed:
T @ ui.b851b4e2.js:213
2jjbS @ ui.b851b4e2.js:351
newRequire @ ui.b851b4e2.js:72
(anonymous) @ ui.b851b4e2.js:123
(anonymous) @ ui.b851b4e2.js:146
(anonymous) @ ui.b851b4e2.js:564257
Show 6 more frames
Show less
ui.b851b4e2.js:151 🟠 WARN | [plasmo/parcel-runtime]: Connection to the HMR server is closed for /Users/*/GolandProjects/*/*/.plasmo/static/contents/ui.tsx
However what has been working is the saving of a file which then reloads the content script page with those changes. Doing some further testing I am finding that it does work if I save the entry content script file after saving the other files. For example: I save a component file I am using in the content script. This does not reload the web page with the content script however the dev server does repackage. I then save the content script entry file this then forces a reload on the web page for the content script and I do see the changes.
Want results from more Discord servers?
Add your server