redfin / react-server

:rocket: Blazing fast page load and seamless navigation.
https://react-server.io/
Apache License 2.0
3.89k stars 184 forks source link

TypeError: require.cache.hasOwnProperty is not a function #942

Open 3lang3 opened 7 years ago

3lang3 commented 7 years ago

platform: win10 *64 node: v 8.1.2 npm : v 5.0.4

3lang3 commented 7 years ago

npm run start error

AlecBoutin commented 6 years ago

Seems to be a problem with Node 8.x. The require.cache object no longer has a hasOwnProperty method. Change is reproducible by openning node REPL and running require.cache.hasOwnProperty.

Full stack trace


                if (/node_modules/.test(filename) === false && require.cache.hasOwnProperty(filename)) {
                                                                             ^

TypeError: require.cache.hasOwnProperty is not a function
    at C:\Users\Alec\Code\react-server-test\node_modules\react-server-cli\target\serverSideHotModuleReload.js:37:64
    at Array.map (native)
    at serverSideHotModuleReload (C:\Users\Alec\Code\react-server-test\node_modules\react-server-cli\target\serverSideHotModuleReload.js:36:37)
    at Compiler.<anonymous> (C:\Users\Alec\Code\react-server-test\node_modules\react-server-cli\target\compileClient.js:213:45)
    at Compiler.applyPlugins (C:\Users\Alec\Code\react-server-test\node_modules\tapable\lib\Tapable.js:26:37)
    at Watching._done (C:\Users\Alec\Code\react-server-test\node_modules\webpack\lib\Compiler.js:78:17)
    at Watching.<anonymous> (C:\Users\Alec\Code\react-server-test\node_modules\webpack\lib\Compiler.js:61:18)
    at Compiler.emitRecords (C:\Users\Alec\Code\react-server-test\node_modules\webpack\lib\Compiler.js:282:37)
    at Watching.<anonymous> (C:\Users\Alec\Code\react-server-test\node_modules\webpack\lib\Compiler.js:58:19)
    at C:\Users\Alec\Code\react-server-test\node_modules\webpack\lib\Compiler.js:275:11```
gestone commented 6 years ago

Running into the same issue. Any fixes besides downgrading the version of node?

hugotox commented 6 years ago

Same issue. Mac 10.12.6, node 8.3.0

dfadev commented 6 years ago

See PR #947

johndturn commented 6 years ago

It appears that this has been merged, though projects built with the Yeoman generator still have this issue. Any ETA on when the generator will be updated?

gigabo commented 6 years ago

I've updated the dependency versions in the generator in v0.7.1.

dfadev commented 6 years ago

npm publish? lerna publish?