You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created this project by initializing TS and Node projects in a new directory...
mkdir hello-web
cd hello-web
tsc --init
npm init -y
...and then adding an index.html file which references index.ts. The TS file adds text to an empty <h1> element when it is loaded.
To Reproduce the Issue:
(Using Parcel 2.9.3)
Clone this repo, cd into the parcel-hmr-issue-repro directory, and run npx parcel index.html
Open http://localhost:1234 in your browser
You should see a page with an <h1> element containing the text "Hello World"
With the Parcel server still running, change title.textContent in index.ts to something different and save the file.
At this point I would have expected to see the text on the page update, but it doesn't. All I see is a "console was cleared" message in the JS console. In order to see an update I must manually refresh the browser page.
Incidentally, I went to the line of code which clears the console and set a breakpoint a few lines earlier in the onmessage handler, just below where the HMRMessage is being parsed. Then I made another update to my index.ts file. When inspecting the data, I can see the TS changes I made in data.assets[0].output.
Here's a github repo with a super simple node web app using TypeScript that reproduces the issue:
https://github.com/programmist/parcel-hmr-issue-repro
I created this project by initializing TS and Node projects in a new directory...
mkdir hello-web cd hello-web tsc --init npm init -y
...and then adding an
index.html
file which referencesindex.ts
. The TS file adds text to an empty<h1>
element when it is loaded.To Reproduce the Issue:
(Using Parcel 2.9.3)
parcel-hmr-issue-repro
directory, and runnpx parcel index.html
http://localhost:1234
in your browser<h1>
element containing the text "Hello World"title.textContent
inindex.ts
to something different and save the file.At this point I would have expected to see the text on the page update, but it doesn't. All I see is a "console was cleared" message in the JS console. In order to see an update I must manually refresh the browser page.
Incidentally, I went to the line of code which clears the console and set a breakpoint a few lines earlier in the
onmessage
handler, just below where theHMRMessage
is being parsed. Then I made another update to myindex.ts
file. When inspecting the data, I can see the TS changes I made indata.assets[0].output
.Originally posted by @programmist in #6685 (comment)
The text was updated successfully, but these errors were encountered: