Skip to content

Commit

Permalink
fix for #942, require.cache.hasOwnProperty call for Node 8 (#947)
Browse files Browse the repository at this point in the history
* fix require.cache.hasOwnProperty call for Node 8

* npm nuke script needs "rm -rf node_modules" in case node_modules doesn't exist

* add notes about dependencies to MAINTAINING.md
  • Loading branch information
dfadev authored and gigabo committed Sep 8, 2017
1 parent 95ac361 commit 6b96e0b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions MAINTAINING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### Dependencies

- `npm install -g rimraf`
- `npm install -g lerna`
- `npm install -g del-cli`

### Deployment Checklist

- `git checkout master && git pull upstream master`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"bootstrap-no-i": "lerna bootstrap",
"test": "lerna run test",
"clean": "rimraf lerna-debug.log && lerna run clean",
"nuke": "npm run clean && lerna clean --yes && rm -r node_modules",
"nuke": "npm run clean && lerna clean --yes && rm -rf node_modules",
"changelog": "lerna-changelog",
"debug": "cat lerna-debug.log && for d in packages/*/npm-debug.log*; do echo $d; cat $d; done",
"postinstall": "npm run bootstrap-no-i",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-server-cli/src/serverSideHotModuleReload.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function serverSideHotModuleReload (webpackStats) {
// For now, loop through all of the project code to remove require caches so that we ensure the server is most up
// to date.
Object.keys(require.cache).map((filename) => {
if (/node_modules/.test(filename) === false && require.cache.hasOwnProperty(filename)) {
if (/node_modules/.test(filename) === false && Object.prototype.hasOwnProperty.call(require.cache, filename)) {
logger.info(`Reloading file: ${filename}`);
delete require.cache[filename];
}
Expand Down

0 comments on commit 6b96e0b

Please sign in to comment.