carbon-io / fibers

MIT License
0 stars 3 forks source link

module name clashes with laverdet/node-fibers #1

Closed gregbanks closed 7 years ago

gregbanks commented 8 years ago

when flattening node_modules (npm3) var Fiber = require('fibers') resolves to the same module yielding an empty object (Fiber === {}) instead of the expected laverdet/node-fibers Fiber function.

> node debug test/All.js
< Debugger listening on port 5858
debug> . ok
break in test/All.js:1
> 1 var o  = require('atom').o(module).main
  2 var oo  = require('atom').oo(module)
  3 var _o = require('bond')._o(module)
debug> c
break in /Users/Greg/devel/repos/carbon-io/atom/node_modules/fibers/index.js:4
  2 require('fibrous')
  3
> 4 debugger
  5
  6 /*******************************************************************************
debug> require.resolve('fibers')
'/Users/Greg/devel/repos/carbon-io/carbond/node_modules/fibers/fibers.js'
debug> repl
Press Ctrl + C to leave debug repl
> Fiber
{}
debug> c
< { [Error: Cannot find module './build/Release/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
< { [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
< { [Error: Cannot find module './build/Debug/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
< /Users/Greg/devel/repos/carbon-io/atom/node_modules/fibers/index.js:136
<   Fiber(function() {
<   ^
< TypeError: Fiber is not a function
<     at spawn (/Users/Greg/devel/repos/carbon-io/atom/node_modules/fibers/index.js:136:3)
<     at result (/Users/Greg/devel/repos/carbon-io/atom/node_modules/fibers/index.js:20:7)
<     at Atom._runMain (/Users/Greg/devel/repos/carbon-io/atom/lib/atom.js:379:7)
<     at Atom._makeObject (/Users/Greg/devel/repos/carbon-io/atom/lib/atom.js:159:16)
<     at Atom.make (/Users/Greg/devel/repos/carbon-io/atom/lib/atom.js:114:24)
<     at makeOFunc (/Users/Greg/devel/repos/carbon-io/atom/lib/atom.js:745:19)
<     at Object.<anonymous> (/Users/Greg/devel/repos/carbon-io/carbond/test/All.js:9:18)
<     at Module._compile (module.js:409:26)
<     at Object.Module._extensions..js (module.js:416:10)
<     at Module.load (module.js:343:32)
program terminated
willshulman commented 7 years ago

Resolved via scopes