Changes made in angular2-hmr 0.5.3 cause a failure in browser in prod builds of angular2-webpack-starter. I'm not sure if this is ultimately something to fix here or in angular2-hmr, though it can be temporarily alleviated here by forcing the dependency if anybody else is affected.
Steps to reproduce
Checkout angular2-webpack-starter at revision f78aeb4, and install all dependencies
Run npm ls angular2-hmr - if it is not 0.5.4 then run npm install angular2-hmr@0.5.4 to force it (and then check with npm ls)
Run npm run build:prod && npm run server:prod
Open browser, go to localhost:8080, nothing will load. Look at dev console, see error:
Uncaught ReferenceError: process is not defined (hmr-decorator.ts:5)
...
Diagnosis
The error doesn't occur in angular2-hmr version 0.5.2:
npm install angular2-hmr@0.5.2 to force that version
npm run build:prod && npm run server:prod
Open browser, see that everything loads without any errors.
Locally, I have updated my package.json to force the angular2-hmr dependency to =0.5.2. I'll submit a bug and PR to angular-hmr to make that check more lenient.
This is a bug report
Overview
Changes made in
angular2-hmr 0.5.3
cause a failure in browser in prod builds ofangular2-webpack-starter
. I'm not sure if this is ultimately something to fix here or inangular2-hmr
, though it can be temporarily alleviated here by forcing the dependency if anybody else is affected.Steps to reproduce
angular2-webpack-starter
at revisionf78aeb4
, and install all dependenciesnpm ls angular2-hmr
- if it is not0.5.4
then runnpm install angular2-hmr@0.5.4
to force it (and then check withnpm ls
)npm run build:prod && npm run server:prod
localhost:8080
, nothing will load. Look at dev console, see error:Diagnosis
The error doesn't occur in
angular2-hmr
version0.5.2
:npm install angular2-hmr@0.5.2
to force that versionnpm run build:prod && npm run server:prod
angular2-hmr
seems to be looking for theprocess
global, which doesn't exist in the browser. This code was introduced in v0.5.3 (https://github.com/gdi2290/angular2-hmr/commit/fed06b8)Temporary Fix
Locally, I have updated my
package.json
to force theangular2-hmr
dependency to=0.5.2
. I'll submit a bug and PR toangular-hmr
to make that check more lenient.Environment