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 with conditional requiring #56

Closed
bergie opened this issue Apr 24, 2014 · 3 comments
Closed

Error with conditional requiring #56

bergie opened this issue Apr 24, 2014 · 3 comments

Comments

@bergie
Copy link

bergie commented Apr 24, 2014

In NoFlo we support both browser and Node.js, and I'm currently looking to port our build setup to the new builder2 to get rid of issues like componentjs/builder.js#125.

However, it seems the builder's require normalization can't deal with conditional requires, like:

unless exports.isBrowser()
  exports.ComponentLoader = require('./nodejs/ComponentLoader').ComponentLoader
else
  exports.ComponentLoader = require('./ComponentLoader').ComponentLoader

There have been similar issues reported before but apparently closed unresolved #36

I'm trying to wrap this into a Grunt plugin, and looking at scripts.js, resolution errors on local project get thrown. This makes my build fail:

screenshot 2014-04-24 at 20 45 52

@jonathanong
Copy link
Contributor

gah i guess we can just make it a warning. i hate when people do this stuff and try/catchs.

@lvivier
Copy link

lvivier commented Apr 29, 2014

+1 to making this a warning, we do lots of models with modella and they all require in different storage plugins and stuff depending on the environment

@timaschew
Copy link
Member

fixed in #73

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

4 participants