question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"ember build" Fails in Nested Addon Situation

See original GitHub issue

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 (<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:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
kkincadecommented, Jun 26, 2018

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.

1reaction
jasonmitcommented, Jun 25, 2018

Ah, I believe I know what is happening here. Thanks for the thorough explanation, I’ll try and have a fix today or tomorrow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Addon doesn't work as a nested dependency · Issue #73 ... - GitHub
Hey folks First of all I want to say thanks for a great addon! ... hooks are not called in a nested fashion...
Read more >
How should we resolve conflicting addons and dependencies?
Sometimes different conflicting versions of an addon can appear in the dep tree of an ember app, which causes unexpected behavior.
Read more >
Nested partial not working - ember.js - Stack Overflow
hbs, I put {{partial 'layout/header'}} but when :I run the server it says Uncaught Error: Assertion Failed: Unable to find partial with name...
Read more >
ember-engines - npm
ember -engines npm version Build Status. This Ember addon implements the functionality described in the Ember Engines RFC.
Read more >
ember-cli-dependency-checker | Yarn - Package Manager
Ember CLI Dependency Checker Build status Code Climate Ember Observer Score. An Ember CLI addon that checks for missing npm and bower dependencies...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found