nadav-dav / rekuire

'rekuire' is basically node's 'require' without the relative paths
93 stars 10 forks source link

Hard to debug error with rekuire #13

Closed tnrich closed 8 years ago

tnrich commented 9 years ago

I just tried to refactor my app to use rekuire, and my functional tests are working, but when bundling up my app using webpack, I'm getting this error:

./~/rekuire/lib/helpers/scanner.js
Module not found: Error: Cannot resolve module 'fs' in /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/lib/helpers
resolve module fs in /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/lib/helpers
  looking for modules in /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules
    /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs doesn't exist (module as directory)
    resolve 'file' fs in /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules
      resolve file
        /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs doesn't exist
        /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs.js doesn't exist
        /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs.json doesn't exist
        /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs.coffee doesn't exist
  looking for modules in /Users/tnrich/Sites/openVectorEditor/node_modules
    /Users/tnrich/Sites/openVectorEditor/node_modules/fs doesn't exist (module as directory)
    resolve 'file' fs in /Users/tnrich/Sites/openVectorEditor/node_modules
      resolve file
        /Users/tnrich/Sites/openVectorEditor/node_modules/fs doesn't exist
        /Users/tnrich/Sites/openVectorEditor/node_modules/fs.js doesn't exist
        /Users/tnrich/Sites/openVectorEditor/node_modules/fs.json doesn't exist
        /Users/tnrich/Sites/openVectorEditor/node_modules/fs.coffee doesn't exist
[/Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs]
[/Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs]
[/Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs.js]
[/Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs.json]
[/Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs.coffee]
[/Users/tnrich/Sites/openVectorEditor/node_modules/fs]
[/Users/tnrich/Sites/openVectorEditor/node_modules/fs]
[/Users/tnrich/Sites/openVectorEditor/node_modules/fs.js]
[/Users/tnrich/Sites/openVectorEditor/node_modules/fs.json]
[/Users/tnrich/Sites/openVectorEditor/node_modules/fs.coffee]
 @ ./~/rekuire/lib/helpers/scanner.js 3:9-22

./~/rekuire/lib/helpers/findBase.js
Module not found: Error: Cannot resolve module 'fs' in /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/lib/helpers
resolve module fs in /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/lib/helpers
  looking for modules in /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules
    /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs doesn't exist (module as directory)
    resolve 'file' fs in /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules
      resolve file
        /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs doesn't exist
        /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs.js doesn't exist
        /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs.json doesn't exist
        /Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs.coffee doesn't exist
  looking for modules in /Users/tnrich/Sites/openVectorEditor/node_modules
    /Users/tnrich/Sites/openVectorEditor/node_modules/fs doesn't exist (module as directory)
    resolve 'file' fs in /Users/tnrich/Sites/openVectorEditor/node_modules
      resolve file
        /Users/tnrich/Sites/openVectorEditor/node_modules/fs doesn't exist
        /Users/tnrich/Sites/openVectorEditor/node_modules/fs.js doesn't exist
        /Users/tnrich/Sites/openVectorEditor/node_modules/fs.json doesn't exist
        /Users/tnrich/Sites/openVectorEditor/node_modules/fs.coffee doesn't exist
[/Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs]
[/Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs]
[/Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs.js]
[/Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs.json]
[/Users/tnrich/Sites/openVectorEditor/node_modules/rekuire/node_modules/fs.coffee]
[/Users/tnrich/Sites/openVectorEditor/node_modules/fs]
[/Users/tnrich/Sites/openVectorEditor/node_modules/fs]
[/Users/tnrich/Sites/openVectorEditor/node_modules/fs.js]
[/Users/tnrich/Sites/openVectorEditor/node_modules/fs.json]
[/Users/tnrich/Sites/openVectorEditor/node_modules/fs.coffee]
 @ ./~/rekuire/lib/helpers/findBase.js 1:9-22

Any ideas what might be causing it/how to fix it?

nadav-dav commented 9 years ago

do you run it in Node? or on the browser? It looks like it is missing the fs module (file system), that only exists server side.

can you provide more info about how you run your app?