"ember build" Fails in Nested Addon Situation
See original GitHub issueI 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 (<anonymous>) 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 (<anonymous>) 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?
Environment
- Ember Version: 3.1.0
- Ember CLI Version: 3.1.4
- Ember Intl Version: 3.0.0
- Node Version: 8.11.3
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
Oh my goodness. I had…
…and was missing the
included
method. Thanks so much for pointing me in the right direction. Sorry for the inconvenience.Ah, I believe I know what is happening here. Thanks for the thorough explanation, I’ll try and have a fix today or tomorrow.