Questions tagged [webpack-hmr]

343 questions
11
votes
0 answers

Angular 7+: HMR (Hot Module Replacement) does not work if any route-resolve involved

HMR (Hot Module Replacement) is a great functionality, that works properly if no "Route-resolve" (see below) is present. If I remove resolve here: { path: 'new', component: BookNewComponent, data: { breadcrumb:…
user3025289
11
votes
5 answers

Include importable modules from outside project folder for webpack HMR Vue.js

I have a project structure like: . +-- Common | +-- MyCommonVueComponent.Vue +-- MainProject | +-- webpack.config.js | +-- package.json | +-- node_modules | +-- src When I a build from the console webpack does not complain as it seemingly…
billy jean
  • 1,399
  • 4
  • 25
  • 45
11
votes
3 answers

Hot module replacement - Updating but not re-rendering

I am running an express server that will act as an API for my React app that is being bundled and served by webpack-dev-server. I am trying to get hot module replacement to work, and am almost there, when I make changes to my files, I get this in…
10
votes
5 answers

Hot module replacement for native ES Modules (browser or Node.js) *without* Webpack? No build tools

I'm looking to add HMR to plain Node.js code or browser code written with native ES Modules. There's no Babel, no Webpack, no transpilation, just plain JS files and ES Module import and export calls. Can we do HMR in plain Node or browser?
trusktr
  • 44,284
  • 53
  • 191
  • 263
9
votes
1 answer

How to setup Webpack's HMR in NestJS project in Nx monorepo?

I am trying to enable Webpack HMR in nestjs app in Nx monorepo The nx workspace with nestjs app can be found in the repo here. It is created by following official docs Nestjs webpack HMR docs is here I successfully enabled Webpack HMR in nestjs app…
9
votes
1 answer

HMR fails with Angular 9 + IVY: Type AppComponent is part of the declarations of 2 modules: AppModule and AppModule

Affected Package HMR + IVY Is this a regression? pre-IVY, it works Description Seems IVY and HMR don't play well together? However I've seen tickets of them that are closed so I suppose it should be possible. I have on re-load after code…
1antares1
  • 1,146
  • 2
  • 11
  • 19
9
votes
0 answers

EventSource's response has a MIME type ("text/html") that is not "text/event-stream". Aborting the connection

I've read a lot about this error, and I can't find the solution. hot reloading is not working, and I have an error: EventSource's response has a MIME type ("text/html") that is not "text/event-stream". Aborting the connection. "webpack":…
klijakub
  • 845
  • 11
  • 31
9
votes
1 answer

Angular Material Dialog & Hot Module Reload

So far, I've successfully done the following: ✓ HMR (Hot Module Reload) set up ✓ Angular (5) and Material working well ✓ Open a dialog (code snippet below) // ... constructor(private dialog: MatDialog){} //... public openDialog(){ this.dialogRef…
Augie Gardner
  • 2,749
  • 3
  • 25
  • 36
9
votes
3 answers

index.html using webpack-dev-server not reload

When I change my app.js and main.css while webpack-dev-server is running, the bundle is updated. But when i change the index.html the content is not refreshed; if I add a line to the HTML, the webpack-dev-server does not refresh anything on the…
8
votes
3 answers

How to set up webpack-hot-middleware in an express app?

I am trying to enable webpack HMR in my express app. It's NOT an SPA app. For the view side, I am using EJS and Vue. I don't have the advantage of vue-cli here so I have to manually configure the vue-loader for the SFCs(.vue files) in the webpack.…
Tanmay
  • 3,009
  • 9
  • 53
  • 83
8
votes
1 answer

HMR is appending instead of replacing

this is my initial load of my page: after ich change some text the HMR get fired up, but appends the DOM instead of replacing it: does anybody have a clue what could cause this issue? there are no errors on console. Update: i used the ASP.NET Core…
Daniel
  • 9,491
  • 12
  • 50
  • 66
8
votes
3 answers

WebPack disable HMR

I am trying to run a simple webpack-dev-server that compiles .bundle.js files when they are requested if relevant source JavaScript files have changed. I do not want to enable Hot Module Replacement (HMR) at this time. I have the server working, but…
Jordan Place
  • 153
  • 1
  • 1
  • 7
7
votes
1 answer

How do I make webpack Hot Module Replacement work with handlebars templates?

I am using handlebars-loader: { test: /\.hbs$/, loader: 'handlebars-loader', } I am also using the html-webpack-plugin. Everything works as I want it using Webpack Dev Server: automatically reloading the page if changes to the…
user10686399
7
votes
2 answers

How can set up my Vue.js site to clear the browser's Javascript console on every hot reload event?

I have a Vue.js site with Webpack Dev Middleware (served via an ASP.NET Core site by HTTP.sys web server, though I'm guessing that doesn't matter). Does anyone know how I can set up my site to clear the browser's Javascript console on every hot…
7
votes
0 answers

How to silence webpack HMR console output

I have a simple webpack setup with HotModuleReplacementPlugin() added. I run webpack via it's NodeJS API. compiler.watch( { stats: 'errors-only' }, () => { console.log('Webpack is watching files.'); }); By specifying the stats option I am…
Shriharsha KL
  • 317
  • 1
  • 2
  • 11
1
2
3
22 23