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

Error: TypeError when using with browserify #1

Closed
DoomyTheFroomy opened this issue Nov 18, 2015 · 1 comment
Closed

Error: TypeError when using with browserify #1

DoomyTheFroomy opened this issue Nov 18, 2015 · 1 comment

Comments

@DoomyTheFroomy
Copy link

When I try to run the created bundle js I'm getting the following error:

TypeError: 'undefined' is not an object (evaluating 'sources[name][1]')

It seems that sources[names] is undefined. It looks like that your bugfix doesn't solved the problem.

@DoomyTheFroomy
Copy link
Author

Ok I have found my problem, I have fresh-require required within a mocha test case description, e.g.

describe('I will test it', function () {
  var fresh = require('fresh-require')
  assert(fresh) //will fail
})

but

var fresh = require('fresh-require')
describe('I will test it', function () {
  assert(fresh) //will work
})

Anyway i'll have to do some modifications to the browser.js

var map
if (sources[name]) {
  map  = sources[name][1]  
} else {
  map = {}
}

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

1 participant