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

addon-info returning "Uncaught TypeError: template.asWrappedLayout is not a function" #5036

Closed
transitorytammy opened this issue Dec 18, 2018 · 12 comments

Comments

@transitorytammy
Copy link

Describe the bug
I am trying to add @storybook/addon-info to my ember storybook repo.

This is what my .storybook/config.js file looks like.

import { configure, addDecorator } from '@storybook/ember';
import { withInfo } from "@storybook/addon-info";
import { withNotes } from '@storybook/addon-notes';
import { checkA11y } from "@storybook/addon-a11y";
import Centered from "@storybook/addon-centered/ember";

addDecorator(withInfo);
addDecorator(withNotes);
addDecorator(checkA11y);
addDecorator(Centered);

function loadStories() {
    require('../stories/index.js');
    // You can require as many stories as you need.
}

configure(loadStories, module);

When I go to http://localhost:9001/, I see this error in the console and my elements don't load on the page.

screen shot 2018-12-18 at 10 46 14 am

screen shot 2018-12-18 at 10 52 57 am

To Reproduce
Steps to reproduce the behavior:

  1. Go to .storybook/config and add import { withInfo } from "@storybook/addon-info"; and addDecorator(withInfo); to the file.
  2. Start server by running npm run storybook
  3. Go to http://localhost:9001 and open console to see error

Expected behavior
I expect no error and to be able to use addon-info

System:

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

igor-dv commented Dec 29, 2018

If you leave only an info addon configured, does the error remain?

@transitorytammy
Copy link
Author

hi @igor-dv. i tried removing everything else and just using the info addon and i am still getting the same error.

@gabrielcsapo
Copy link
Contributor

@transitorytammy can you comment the version of ember you are using and the story code?

@transitorytammy
Copy link
Author

@gabrielcsapo I am on Ember 3.14

ember-cli: 3.1.4
node: 10.13.0
os: darwin x64

@ilkkao
Copy link

ilkkao commented Jan 20, 2019

I had this error too in my Ember app that uses React. My parent Ember component had layout property set to a string. This stopped working after upgrading Ember. In my case I was simply able to remove the overridden layout and fallback to default layout.

@transitorytammy
Copy link
Author

@ilkkao where did you "remove the overridden layout"? just wondering what file you are talking about adjusting to fix the issue. thanks.

@ilkkao
Copy link

ilkkao commented Jan 30, 2019

I was talking about my Ember component. https://www.emberjs.com/api/ember/release/classes/Component

I'm not sure what the context is here. I just saw the exact same error message in my Ember app and this PR was the only hit when I googled it. Please ignore my comment if you are not using Ember components here.

@stale
Copy link

stale bot commented Feb 21, 2019

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!

@stale stale bot added the inactive label Feb 21, 2019
@shilman
Copy link
Member

shilman commented Feb 22, 2019

@transitorytammy addon-info is only compatible with React at the moment. We'll be moving that functionality to the addons panel and making it cross framework as soon as v5 is released in a few weeks. #1147

Closing this for now.

@shilman shilman closed this as completed Feb 22, 2019
@tau150
Copy link

tau150 commented Jul 17, 2020

@ilkkao I am having the same issue in Ember, I am new in Ember, could you pass me an example of how did you solve it?

@ilkkao
Copy link

ilkkao commented Jul 17, 2020

@tau150 in my case it was ember component with layout property set to HTML string. If you are in same situation you can find it by searching for layout: in your code.

@shilman
Copy link
Member

shilman commented Jul 18, 2020

Addon-info is being superceded by addon-docs, which fixes a bunch of bugs and is easier to maintain. Please give it a try! https://medium.com/storybookjs/storybook-docspage-e185bc3622bf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants