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

Exposed module requiring other exposed module results in error when using cache #22

Open
thedufer opened this issue Oct 23, 2015 · 2 comments · May be fixed by browserify/browserify#1415

Comments

@thedufer
Copy link

For a minimal example, put in file a.js:

module.exports = 'hi';

And in file b.js:

module.exports = require('a');

And compile with browserifyinc --require ./a.js:a --require ./b.js:b. The first time this works fine; the second (after filling the cache) it results in Error: ENOENT, open 'a'. This is because the cache contains

      "deps": {
        "a": "a"
      }

We should not try to open that, since it is a module name and not a file path.

  • Note: The module.exports setting is irrelevant, but useful if you want to see that this is a meaningful thing to do. In file c.js:
console.log(require('a'))
console.log(require('b'))

And then compile with browserifyinc --external a --external b c.js. When run after the first bundle, this will print 'hi' twice.

@thedufer thedufer linked a pull request Oct 26, 2015 that will close this issue
@thedufer
Copy link
Author

This might actually be a browserify issue. I've submitted a PR there, so we'll see.

@VanCoding
Copy link

I've opened a ticket on browserify-cache-api that might be related to this:
jsdf/browserify-cache-api#10

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

Successfully merging a pull request may close this issue.

2 participants