Storybook: Ember Error: Assertion Failed: You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Applicatiom

Created on 2 Jan 2019  路  9Comments  路  Source: storybookjs/storybook

Describe the bug
I am building an ember-addon and am getting this error when installing storybook in the console.

Assertion Failed: You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application

screen shot 2019-01-02 at 12 08 10 pm

To Reproduce
Steps to reproduce the behavior:

  1. add storybook to ember-addon repository
  2. open console and see above error

Expected behavior
No error.

System:

  • OS: [MacOS]
  • Device: [Macbook Pro 2018]
  • Browser: [chrome]
  • Framework: [ember]
  • Addons: [@storybook/addon-a11y]
  • Version: [e.g. 4.0.0]
ember inactive

Most helpful comment

For anyone coming here with the same symptoms, I thought I'd share something that worked for us. It seems the storybook integration for ember is depending on ENV.APP.autoboot to be false. When storybook was running, this setting was correctly set to false. But in the build phase, it wasn't. We had to make sure to run ember build in an environment that set ENV.APP.autoboot = false. In our case, that meant:

ember build --environment test

If this doesn't work for you, check config/environment.js to make sure autoboot is set correctly.

The symptoms we had except for the same You cannot make a new Ember.Application error being logged in the javascript console was that our login screen showed up instead of the stories. This only happened on initial load however, if you refreshed the storybook page the issue went away.

All 9 comments

This is an error we are trying to work on to resolve with the ember-core team. It is dealing with loading the application twice, the fix is to use the add-on and make sure that the EMBER_ENVIRONMENT is set to testing and it is ensuring that fast boot is turned off.

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@gabrielcsapo you mentioned the fix to this is using the add-on. do you mean https://github.com/storybooks/ember-cli-storybook ? Does that mean I would remove all the npm packages I have already added given I used this set of instructions for setting up? https://storybook.js.org/basics/guide-ember/

@transitorytammy I have an RB open to update the docs to reflect the ability to use the blueprints ember-cli-storybook would you see if that helps https://github.com/storybooks/storybook/pull/5489?

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

I did run ember b --environment=test
and then ran storybook script. it worked

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

For anyone coming here with the same symptoms, I thought I'd share something that worked for us. It seems the storybook integration for ember is depending on ENV.APP.autoboot to be false. When storybook was running, this setting was correctly set to false. But in the build phase, it wasn't. We had to make sure to run ember build in an environment that set ENV.APP.autoboot = false. In our case, that meant:

ember build --environment test

If this doesn't work for you, check config/environment.js to make sure autoboot is set correctly.

The symptoms we had except for the same You cannot make a new Ember.Application error being logged in the javascript console was that our login screen showed up instead of the stories. This only happened on initial load however, if you refreshed the storybook page the issue went away.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ZigGreen picture ZigGreen  路  3Comments

tlrobinson picture tlrobinson  路  3Comments

oriSomething picture oriSomething  路  3Comments

miljan-aleksic picture miljan-aleksic  路  3Comments

dnlsandiego picture dnlsandiego  路  3Comments