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.

Storybook broken in Ember 4.X

See original GitHub issue

Describe the bug Storybook is completely broken when trying to use it in Ember 4.X Ember 4 removes deprecated features, one of those being Global Ember usage. See https://github.com/storybookjs/ember-cli-storybook/issues/103 for more information

After doing a bit of research there are a few target areas that will need to be fixed.

  1. You’ll need to use babel-plugin-ember-template-compilation here
var extraPlugins = [[require.resolve('babel-plugin-ember-template-compilation'), {
      precompile: precompileWithPlugins,
      outputModuleOverrides: {
            '@ember/template-factory': {
              createTemplateFactory: ['createTemplateFactory', '@glimmer/core'],
            }
          },
    enableLegacyModules: ['ember-cli-htmlbars', 'ember-cli-htmlbars-inline-precompile', 'htmlbars-inline-precompile']
  }]];
  1. You’ll need to update https://github.com/storybookjs/storybook/blob/4b47793e118f091971f2a453d486c5f01875811d/app/ember/src/client/preview/render.ts#L41 to remove the global ember usage. There is a pull request for this already, but Im not quite sure if you will also have to update it to be a glimmer component and use setComponentTemplate.

  2. You might need https://github.com/glimmerjs/glimmer-vm/issues/1252 to be fixed - because you’ll run into that once you make the first change.

Even with all this, I still wasn’t able to get it 100% working - but I was able to bypass the Ember is not defined error.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
olycknecommented, Nov 28, 2022

@pomm0 I’ve solved that by putting an override in package.json.

"overrides": {
    "@storybook/ember": {
      "ember-source": "~4.8.0"
    },
}
0reactions
pomm0commented, Nov 25, 2022

I’m also not able to update my addon to Ember version 4. But I stuck at the very first step: installing node modules because storybooks’ package.json only allows ember 3.x:

"ember-source": "^3.16.0"
Read more comments on GitHub >

github_iconTop Results From Across the Web

Storybook broken in Ember 4.X #18028 - Issuehunt
Describe the bug Storybook is completely broken when trying to use it in Ember 4.X Ember 4 removes deprecated features, one of those...
Read more >
@storybook/ember - npm
Storybook for Ember is a UI development environment for your Ember components. With it, you can visualize different states of your UI components ......
Read more >
Storybook - Ember.js - Getting stuck on loading state
This is due to a limitation because today the install steps are a bit broken and need to be fixed, that's why we...
Read more >
Docs Addon | Storybook: Frontend workshop for UI development
DocsPage is a zero-config aggregation of your component stories, text descriptions, docgen comments, props tables, and code examples into clean, readable pages.
Read more >
Ember with Storybook – Behind the Scenes
A story for ember is a template and optionally a context object. These two stories demonstrate this for the button component: // components/button/stories.js ......
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