react-server icon indicating copy to clipboard operation
react-server copied to clipboard

TypeError: require.cache.hasOwnProperty is not a function

Open 3lang3 opened this issue 7 years ago • 8 comments

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

3lang3 avatar Jun 30 '17 07:06 3lang3

npm run start error

3lang3 avatar Jun 30 '17 08:06 3lang3

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```

AlecBoutin avatar Jul 25 '17 12:07 AlecBoutin

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

gestone avatar Aug 03 '17 04:08 gestone

Same issue. Mac 10.12.6, node 8.3.0

hugotox avatar Aug 10 '17 17:08 hugotox

See PR #947

dfadev avatar Aug 15 '17 23:08 dfadev

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?

johndturn avatar Sep 20 '17 19:09 johndturn

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

gigabo avatar Sep 25 '17 23:09 gigabo

npm publish? lerna publish?

dfadev avatar Sep 26 '17 03:09 dfadev