question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module './assets/empty-module.js'

See original GitHub issue

Whenever I try to run react-native I get this error:

react-native run-ios
module.js:474
    throw err;
    ^

Error: Cannot find module './assets/empty-module.js'
    at Function.Module._resolveFilename (module.js:472:15)
    at Function.resolve (internal/module.js:27:19)
    at Object.<anonymous> (/Users/esen/Github/App/node_modules/react-native/packager/react-packager/src/node-haste/DependencyGraph/ResolutionRequest.js:20:29)
    at Module._compile (module.js:573:32)
    at loader (/Users/esen/Github/App/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/esen/Github/App/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.require (module.js:500:17)
  • React Native version: 0.37.0
  • Platform: Both
  • Operating System: MacOS

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:9

github_iconTop GitHub Comments

10reactions
rjzcommented, Dec 3, 2016

Also ran into this; touch-ing empty-module.js also seems to do the trick:

$ (
  cd node_modules/react-native/packager/react-packager/src/node-haste/DependencyGraph/
  mkdir -p assets
  touch assets/empty-module.js
)
9reactions
dsummerslcommented, Jan 28, 2017

Since I didn’t intend to run yarn clean I removed .yarnclean and reinstalled the module - sounds like removing assets from .yarnclean would work too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

1 Answer - 1 - Stack Overflow
Error : Cannot find module './assets/empty-module.js' at Function.Module._resolveFilename (module.js:339:15) at Function.require.resolve ...
Read more >
Search - appsloveworld
Coding example for the question Expo React Native Cannot find module './assets/empty-module.js'-React Native.
Read more >
A brand new website interface for an even better experience!
Error : Cannot find module './assets/empty-module.js'
Read more >
Configuring Metro - Meta Open Source
metro.config.js; metro.config.json; The metro field in package.json ... When Metro needs to transform a module, it first computes a ...
Read more >
require.resolve "Error: Cannot find module" but ... - Reddit
require.resolve "Error: Cannot find module" but module exists in ... resolve because I'm adding dependencies in my webpack.config.js file ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found