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

Cannot read property 'ember-bootstrap' of undefined #120

Closed
GCorbel opened this issue Aug 1, 2016 · 10 comments
Closed

Cannot read property 'ember-bootstrap' of undefined #120

GCorbel opened this issue Aug 1, 2016 · 10 comments

Comments

@GCorbel
Copy link

GCorbel commented Aug 1, 2016

In and Ember 2.7 app, at this line I have this error :

Cannot read property 'ember-bootstrap' of undefined

If I do app = app.app it workes. I'm not working on an addon and the if statement is not true.

I don't know what's the definitive solution. What you think?

@simonihmig
Copy link
Contributor

I have no idea, but ember-bootstrap has a lot of tests that also run for ember 2.7, so really there should be no problem in general. I think there must be something with your particular app. I just recently set up a fresh app with ember-cli 2.7 / ember 2.7 without any problems, so the problem must lie somewhere else unfortunately!

@GCorbel
Copy link
Author

GCorbel commented Aug 6, 2016

@simonihmig I tried to contribute to this addon and I have the problem. I don't see anything special. Please, can you check it?

@GCorbel
Copy link
Author

GCorbel commented Aug 6, 2016

Sorry, I was wrong. Your addon seems to be correct. Thanks.

@GCorbel
Copy link
Author

GCorbel commented Oct 1, 2016

I finally found a way to reproduce the bug. I when ember-bootstrap is an dependency of an addon. For example, a package with this in package.json :

{
  ...
  "dependencies": {
    "ember-cli-babel": "^5.1.3",
    "ember-bootstrap": "0.10.0"
  }
  ...
}

And I have this stack trace :

Cannot read property 'ember-bootstrap' of undefined
TypeError: Cannot read property 'ember-bootstrap' of undefined
    at CoreObject.included (/frontend/node_modules/ember-bootstrap/index.js:26:53)
    at /frontend/node_modules/ember-cli/lib/models/addon.js:258:34
    at Array.map (native)
    at CoreObject.eachAddonInvoke (/frontend/node_modules/ember-cli/lib/models/addon.js:252:24)
    at CoreObject.extend.included (/frontend/node_modules/ember-cli/lib/models/addon.js:435:10)
    at CoreObject.superWrapper [as included] (/frontend/node_modules/core-object/lib/assign-properties.js:32:18)
    at EmberApp.<anonymous> (/frontend/node_modules/ember-cli/lib/broccoli/ember-app.js:468:15)
    at Array.filter (native)
    at EmberApp._notifyAddonIncluded (/frontend/node_modules/ember-cli/lib/broccoli/ember-app.js:463:45)
    at new EmberApp (/frontend/node_modules/ember-cli/lib/broccoli/ember-app.js:136:8)
    at module.exports (/frontend/ember-cli-build.js:7:15)
    at CoreObject.module.exports.Task.extend.setupBroccoliBuilder (/frontend/node_modules/ember-cli/lib/models/builder.js:74:19)
    at CoreObject.module.exports.Task.extend.init (/frontend/node_modules/ember-cli/lib/models/builder.js:54:10)
    at CoreObject.superWrapper [as init] (/frontend/node_modules/core-object/lib/assign-properties.js:32:18)
    at CoreObject.Class (/frontend/node_modules/core-object/core-object.js:32:33)
    at CoreObject.module.exports.Task.extend.run (/frontend/node_modules/ember-cli/lib/tasks/build.js:15:19)
    at CoreObject.<anonymous> (/frontend/node_modules/ember-cli/lib/commands/test.js:164:27)
    at tryCatch (/frontend/node_modules/rsvp/dist/rsvp.js:538:12)
    at invokeCallback (/frontend/node_modules/rsvp/dist/rsvp.js:553:13)
    at /frontend/node_modules/rsvp/dist/rsvp.js:628:16
    at flush (/frontend/node_modules/rsvp/dist/rsvp.js:2370:5)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)

I don't understand why it do that... can you help me?

@viniciussbs
Copy link

@GCorbel Same here: I have an addon that includes ember-bootstrap as its dependency. When I install the addon into another app, I have this error.

@srvance
Copy link
Contributor

srvance commented Mar 20, 2017

@viniciussbs @GCorbel Can you share the addons that include ember-bootstrap with us?

Can you tell us what versions of ember, ember-cli, and ember-bootstrap you're using?

@viniciussbs
Copy link

@srvance It's my own private addon with core UI componentes shared with other apps.

$ ember -v
ember-cli: 2.11.0

"ember-bootstrap": "0.11.1"

One of the apps already have ember-bootstrap (same version) into "devDependencies" as its own dependency.

@Charizard
Copy link
Contributor

Same here. My case exactly is similar to @viniciussbs

@srvance
Copy link
Contributor

srvance commented Aug 10, 2017

Any chance you can upgrade to the latest? We're not making changes to the 0.* versions, and there have been several changes to how the hosting app is identified.

We know that there are some issues with ember-bootstrap as an addon dependency, at least one of which is that ember-cli doesn't have a story for running blueprints of addon dependencies.

It would probably be better to make it a peer dependency if you can and to have your addon's blueprint validate that it's present.

@Charizard
Copy link
Contributor

@srvance I did point to master and it worked like charm. Thanks 🌮

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants