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

Build error when trying to add to a project #21

Closed
backspace opened this issue Jul 4, 2017 · 8 comments
Closed

Build error when trying to add to a project #21

backspace opened this issue Jul 4, 2017 · 8 comments

Comments

@backspace
Copy link

Hey, thanks for creating this, I think it’ll solve a long-standing problem I’ve had with dynamically-determined assets in travis-web testing environments. Sadly when I tried to incorporate it as in this PR, I get this build error:

Cannot read property 'project' of undefined
TypeError: Cannot read property 'project' of undefined
    at Class.postBuild (/home/travis/build/travis-ci/travis-web/node_modules/ember-cli-ifa/index.js:34:31)
    at Class.superWrapper [as postBuild] (/home/travis/build/travis-ci/travis-web/node_modules/ember-cli/node_modules/core-object/lib/assign-properties.js:34:20)
    at addonPromises.project.addons.map.addon (/home/travis/build/travis-ci/travis-web/node_modules/ember-cli/lib/models/builder.js:139:34)
    at Array.map (native)
    at Builder.processAddonBuildSteps (/home/travis/build/travis-ci/travis-web/node_modules/ember-cli/lib/models/builder.js:137:43)
    at tryCatch (/home/travis/build/travis-ci/travis-web/node_modules/rsvp/dist/rsvp.js:539:12)
    at invokeCallback (/home/travis/build/travis-ci/travis-web/node_modules/rsvp/dist/rsvp.js:554:13)
    at publish (/home/travis/build/travis-ci/travis-web/node_modules/rsvp/dist/rsvp.js:522:7)
    at flush (/home/travis/build/travis-ci/travis-web/node_modules/rsvp/dist/rsvp.js:2414:5)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Looking at the file in question doesn’t explain much:

    const ifaConfig = this.app.project.config(env).ifa;

I’d expect this.app, an EmberApp, to always be present, I couldn’t find any Ember CLI changes that would explain this.

The application in question is on Ember and Ember CLI 2.13.3.

Do you have any insight into what this error is about? If there’s any information I can provide that would help with this, let me know.

@RuslanZavacky
Copy link
Contributor

RuslanZavacky commented Jul 4, 2017

Hey @backspace thanks for the report, I'll try to fork travis-web and see what's causing it :) I have some ideas, maybe it will play nicely.

The idea is, that some other addon, uses included hook, but do not call this._super.included.apply(this, arguments);, if this is a case, we just need to find such addon :)

@RuslanZavacky
Copy link
Contributor

Yeap, it looks like it, this addon - ember-cli-inline-images - do not call super in included hook. So because ember-cli-ifa is executed after this addon, for the run of included hooks, we do not set .app, and this.app.project is undefined :)

https://github.com/drogus/ember-cli-inline-images/blob/master/index.js

So the PR for this addon should be made to fix it.

@RuslanZavacky
Copy link
Contributor

Or maybe I was too quick on jumping into conclusion, will take a look a bit more :)

@backspace
Copy link
Author

That theory makes sense to me. I have another task occupying me at the moment but I can come back to this and see if I can find any addons that are misbehaving. If I do, I can definitely make a PR. Thanks for looking into this!

@RuslanZavacky
Copy link
Contributor

@backspace I haven't updated it yet, but yesterday I've done kinda of research, and hit the wall :D new project + ember-cli-ifa, everything works nicely. travis-web, with only dependencies like in the clean ember project - same error. The one interesting thing is, that postBuild hooks this is different in the clean project and the travis one. So maybe, it's not an addon. Also, the another guess is, that I need to update this repo to the latest ember-cli, maybe this will reveal some issues, I'll try to finish a PR for this update soon.

@mydea
Copy link
Contributor

mydea commented Feb 16, 2018

This should be fixed by #33!

@RuslanZavacky
Copy link
Contributor

Released as part o 0.7.0, thanks to @mydea :)

@backspace
Copy link
Author

Excellent, thanks so much!

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

3 participants