I have a custom addon (i.e. @adc/i18n) which lists _ember-intl@^3.0.0_ as a dependency. Running the dummy application for @adc/i18n works without issue. However, when I try to include @adc/i18n within another custom addon of mine as a dependency (i.e. @adc/list-row), I receive the following build error:
ERROR Summary:
- broccoliBuilderErrorStack: [undefined]
- codeFrame: [undefined]
- errorMessage: Cannot read property 'publicOnly' of null
- errorType: [undefined]
- location:
- column: [undefined]
- file: [undefined]
- line: [undefined]
- message: Cannot read property 'publicOnly' of null
- name: TypeError
- nodeAnnotation: [undefined]
- nodeName: [undefined]
- originalErrorMessage: [undefined]
- stack: TypeError: Cannot read property 'publicOnly' of null
at Class.treeForApp (/Users/kameronkincade/Developer/ember-addons/adc-list-row/node_modules/ember-intl/index.js:118:20)
at Class._treeFor (/Users/kameronkincade/Developer/ember-addons/adc-list-row/node_modules/ember-cli/lib/models/addon.js:548:33)
at Class.treeFor (/Users/kameronkincade/Developer/ember-addons/adc-list-row/node_modules/ember-cli/lib/models/addon.js:508:21)
at addons.reduce (/Users/kameronkincade/Developer/ember-addons/adc-list-row/node_modules/ember-cli/lib/models/addon.js:381:26)
at Array.reduce ()
at Class.eachAddonInvoke (/Users/kameronkincade/Developer/ember-addons/adc-list-row/node_modules/ember-cli/lib/models/addon.js:378:24)
at Class.treeFor (/Users/kameronkincade/Developer/ember-addons/adc-list-row/node_modules/ember-cli/lib/models/addon.js:507:22)
at addons.reduce (/Users/kameronkincade/Developer/ember-addons/adc-list-row/node_modules/ember-cli/lib/models/addon.js:381:26)
at Array.reduce ()
at Class.eachAddonInvoke (/Users/kameronkincade/Developer/ember-addons/adc-list-row/node_modules/ember-cli/lib/models/addon.js:378:24)
It seems like the line it's failing on is if (!this.opts.publicOnly) in the _treeForApp_ hook. I can see that this.opts is hit in the _included_ hook, so I'm not sure what is happening. I have an config/ember-intl.js file defined in both @adc/i18n and in @adc/list-row. Oddly, when I change ember-intl to be a devDependency inside @adc/i18n, this allows for a successful build. However, I want it as a dependency.
Any thoughts on why the options are undefined or how to fix it?
Ah, I believe I know what is happening here. Thanks for the thorough explanation, I'll try and have a fix today or tomorrow.
Thanks for the quick response! I'm uploading a screenshot of some of the important variables at that point in time, in case it might help. Seems like the ember-intl/app folder might be the tree causing the issue.

I'm having trouble replicating but I'm certain this bug exists because I've previously accounted for it but lost the ability to reproduce so removed the guards.
So I'm understanding correctly, you have two addons @adc/list-row and @adc/i18n. list-row has a dependency (not devDep) on @adc/i18n. You experience this while running list-row's dummy app. Is that correct?
Any chance you can paste in the package.json files to each project? Would help me immensely to understand how all of it relates.
Side note, the host app will need to declare ember-intl as a devDep as well. This is because the host app dictates how all the translation & locale data is bundled. The addon's config/ember-intl is only used when running the addon's dummy app.
That is correct. I'm not sure which addon/apps config options it's saying are undefined.
@kkincade I've tried to setup an a set of addons with the same configuration and I'm unable to reproduce. Any chance you can push an example to github?
@kkincade can you verify that within your addon's you're calling super in the included hook of index.js? That's the only thing I can think of that reproduces the stacktrace.
If you're reimplemented included you need to invoke
module.exports = {
name: 'x-addon',
included() {
this._super.included.apply(this, arguments);
/* do things */
}
};
Oh my goodness. I had...
included() {
this._super.apply(this, arguments);
}
...and was missing the included method. Thanks so much for pointing me in the right direction. Sorry for the inconvenience.
Most helpful comment
Oh my goodness. I had...
...and was missing the
includedmethod. Thanks so much for pointing me in the right direction. Sorry for the inconvenience.