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

Getting undefined error when the value is set to false. #29

Closed
eqbal opened this issue Nov 22, 2016 · 3 comments
Closed

Getting undefined error when the value is set to false. #29

eqbal opened this issue Nov 22, 2016 · 3 comments

Comments

@eqbal
Copy link

eqbal commented Nov 22, 2016

i'm using ember 2.5 and everything is working as expected when I define var as true, however when I define variable as false I'm having an error:

Cannot read property 'ENABLE_FOO' of undefined
TypeError: Cannot read property 'ENABLE_FOO' of undefined
  at /myproject/node_modules/ember-cli-conditional-compile/index.js:63:64
  at Array.map (native)
  at Class.postprocessTree (/Users/info/code/mesitis/canopy-fresh/node_modules/ember-cli-conditional-compile/index.js:62:38)
  at /myproject/node_modules/ember-cli/lib/broccoli/ember-app.js:508:27
  at Array.forEach (native)
  at EmberApp.addonPostprocessTree (/myproject/node_modules/ember-cli/lib/broccoli/ember-app.js:506:23)
  at EmberApp.appAndDependencies (/myproject/node_modules/ember-cli/lib/broccoli/ember-app.js:1050:31)
  at EmberApp.javascript (/myproject/node_modules/ember-cli/lib/broccoli/ember-app.js:1161:34)
  at EmberApp.toArray (/myproject/node_modules/ember-cli/lib/broccoli/ember-app.js:1566:10)
  at EmberApp.toTree (/myproject/node_modules/ember-cli/lib/broccoli/ember-app.js:1588:30)
  at module.exports (/myproject/ember-cli-build.js:85:14)
  at Class.setupBroccoliBuilder (/myproject/node_modules/ember-cli/lib/models/builder.js:54:19)
  at Class.init (/myproject/node_modules/ember-cli/lib/models/builder.js:89:10)
  at Class.superWrapper [as init] (/myproject/node_modules/ember-cli/node_modules/core-object/lib/assign-properties.js:32:18)
  at Class (/myproject/node_modules/ember-cli/node_modules/core-object/core-object.js:32:33)
  at Class.run (/myproject/node_modules/ember-cli/lib/tasks/serve.js:15:19)
  at /myproject/node_modules/ember-cli/lib/commands/serve.js:64:24
  at tryCatch (/myproject/node_modules/rsvp/dist/rsvp.js:538:12)
  at invokeCallback (/myproject/node_modules/rsvp/dist/rsvp.js:553:13)
  at /myproject/node_modules/rsvp/dist/rsvp.js:628:16
  at flush (/myproject/node_modules/rsvp/dist/rsvp.js:2373:5)
  at _combinedTickCallback (internal/process/next_tick.js:67:7)
  at process._tickDomainCallback (internal/process/next_tick.js:122:9)

Please note that in my environment.js file :

  var ENV = {
    featureFlags: {
      ENABLE_FOO: false
    },

If I turn it to true everything works as expected.

Any help? thanks

@tehmaestro
Copy link

tehmaestro commented Jan 31, 2017

I get the same thing, did you manage to fix it? Thanks.

Edit: I got it working by initializing the ENV.includeDirByFlag property with an empty object

@jobackman
Copy link
Contributor

Like @tehmaestro said this is because includeDirByFlag is undefined.
I do like the readme and have an includeDirByFlag for every featureFlag I have, but as empty arrays:

var ENV = {
    // other settings ...

    featureFlags: {
        ENABLE_FOO: true,
        ENABLE_BAR: true
    },
    includeDirByFlag: {
        ENABLE_FOO: [/pods\/foos/, /pods\/foo/],
        ENABLE_BAR: [],
    }
};

I suggest we close this issue and keep #26 open since it is the same problem.

@minichate
Copy link
Owner

Closing. Thanks!

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