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 installed parcel v2 in my electron/react/ts project. Parcel runs correctly and if I save a file, the parcel rebuilds but the page in the electron doesn't reload automatically. I mean, the parcels rebuilds but the page in the electron (chromium) doesn't.
The project's bundler previously was webpack, but I installed parcel v2 for easier hmr config.
importReactfrom"react";importReactDOMfrom'react-dom';importAppfrom'./App';//: primereact theme and css file// import 'primereact/resources/themes/saga-blue/theme.css';import"../../node_modules/primereact/resources/primereact.min.css";import"../../node_modules/primereact/resources/themes/fluent-light/theme.css";//: prime iconsimport"../../node_modules/primeicons/primeicons.css";//: primefleximport"../../node_modules/primeflex/primeflex.css";//: main css file (+tailwindcss in it)import'./main.css';constroot=document.createElement('div');root.classList.add('root-element')document.body.appendChild(root);ReactDOM.render(<App/>, root);
🤔 Expected Behavior
If I save a file, the parcel should rebuild and the page in electron (chromium) should reload.
😯 Current Behavior
The parcel rebuilds, but the page in electron (chromium) didn't reload.
💁 Possible Solution
I cannot find any possible solution, because it hasn't any error shown. Just not works :)
🔦 Context
I tried to have parcel's hot reload and hot module replace works with my electron renderer process that was written in React and Typescript.
💻 Code Sample
🌍 Your Environment
Software
Version(s)
Parcel
2.0.0-beta.2
Node
v14.16.1
npm
6.14.12
Yarn
v1.22.10
Operating System
Manjaro Linux
Editor
Vscode 1.54.2
Electron
v12.0.2
The text was updated successfully, but these errors were encountered:
MSKhodadady
changed the title
hot reload or hot module replacement not working
hot reload or hot module replacement not working with electron
May 8, 2021
I upgraded parcel from 2.0.0-beta.2 to 2.0.0-beta.3.1, and now the hot module replacement works 😃, but not hot reload 😶.
Wrote in doc, the hot reload works by default and If we add this lines to code 👇, now the hot reload works.
if(module.hot){module.hot.accept();}
But now in my project, either this lines exists or not, the HMR works. This is not problem for me, but I think it is misbehavior, based on documentation.
🐛 bug report
I installed parcel v2 in my electron/react/ts project. Parcel runs correctly and if I save a file, the parcel rebuilds but the page in the electron doesn't reload automatically. I mean, the parcels rebuilds but the page in the electron (chromium) doesn't.
The project's bundler previously was webpack, but I installed parcel v2 for easier hmr config.
🎛 Configuration (.babelrc, package.json, cli command)
package.json
Note that
typescript
was installed for using with webpack, and wasn't used with parcel..postcssrc.json
main.html
main.tsx
🤔 Expected Behavior
If I save a file, the parcel should rebuild and the page in electron (chromium) should reload.
😯 Current Behavior
The parcel rebuilds, but the page in electron (chromium) didn't reload.
💁 Possible Solution
I cannot find any possible solution, because it hasn't any error shown. Just not works :)
🔦 Context
I tried to have parcel's hot reload and hot module replace works with my electron renderer process that was written in React and Typescript.
💻 Code Sample
🌍 Your Environment
The text was updated successfully, but these errors were encountered: