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

Requiring anything but string fails #36

Closed
varemenos opened this issue Jul 25, 2015 · 1 comment
Closed

Requiring anything but string fails #36

varemenos opened this issue Jul 25, 2015 · 1 comment

Comments

@varemenos
Copy link

Ok, so the webapp I'm working on has 3 text editors, most of the configuration is the same for all of them but there are a few options that are passed via an object. My problem is that when I try to insert anything other than a string in require.

var ace = require('brace');
require('brace/theme/monokai');
// works
var ace = require('brace');
require(this.props.theme);
// `Uncaught Error: Cannot find module 'brace/theme/monokai'`

even this doesn't work:

var ace = require('brace');
require('brace/theme/' + 'monokai');
// `Uncaught Error: Cannot find module 'brace/theme/monokai'`
@varemenos varemenos changed the title Requiring anything but strings fails Requiring anything but string fails Jul 25, 2015
@thlorenz
Copy link
Owner

Yep this is how browserify works - has to be statically analyzable.
This won't change, sorry.

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

2 participants