PatrickJS / PatrickJS-starter

MFE Starter
MIT License
10.33k stars 4.9k forks source link

Bug: `angular-hmr` v0.5.3-v0.5.4 causes browser-side exception in prod build #491

Closed jffry closed 8 years ago

jffry commented 8 years ago

This is a bug report

Overview

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

Uncaught ReferenceError: process is not defined (hmr-decorator.ts:5)
...

Diagnosis

The error doesn't occur in angular2-hmr version 0.5.2:

angular2-hmr seems to be looking for the process 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 the angular2-hmr dependency to =0.5.2. I'll submit a bug and PR to angular-hmr to make that check more lenient.

Environment

PatrickJS commented 8 years ago

thanks! I updated the hmr module to 0.5.5 to address this

PatrickJS commented 8 years ago

done via https://github.com/AngularClass/angular2-webpack-starter/commit/bf46a9c129c8074760646c4e8fe97c6e31f86b5c

jffry commented 8 years ago

Fix works like a charm, thanks! ❤️