Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3lang3 opened this issue Jun 30, 2017 · 8 comments
Open

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

3lang3 opened this issue Jun 30, 2017 · 8 comments

Comments

@3lang3
Copy link

3lang3 commented Jun 30, 2017

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

@3lang3
Copy link
Author

3lang3 commented Jun 30, 2017

npm run start error

@AlecBoutin
Copy link

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
Copy link

gestone commented Aug 3, 2017

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

@hugotox
Copy link

hugotox commented Aug 10, 2017

Same issue. Mac 10.12.6, node 8.3.0

@dfadev
Copy link
Contributor

dfadev commented Aug 15, 2017

See PR #947

gigabo pushed a commit that referenced this issue Sep 8, 2017
* 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
@johndturn
Copy link

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
Copy link
Contributor

gigabo commented Sep 25, 2017

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

@dfadev
Copy link
Contributor

dfadev commented Sep 26, 2017

npm publish? lerna publish?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants