-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Hot reloading issue with angular 11 #13243
Comments
WDYT @ThibaudAV @Marklb @kroeder @gaetanmaisse ? |
I don't have the impression that this prevents sotrybook from working properly, no? It seems to be related to Full console output
|
From what I have noticed @ThibaudAV is right. It doesn't seem to be preventing Storybook from working. I did notice this a few weeks ago at least, but I noticed the warnings were for files in I don't know what the problem is at the moment, but I agree that it is most likely an issue with the webpack configuration or the way we build Angular. |
Thanks for looking into this. It does seem true that it only happens once, but in our larger application it seems to happen a bit more occasionally. However, it doesn't seem to be as alarming as I originally thought – it seems to run fairly well after all. |
Automention: Hey @MaximSagan @kroeder, you've been tagged! Can you give a hand here? |
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! |
After using storybook since issue was reported, it is noticeable that HMR doesn't work consistently. |
@nomadoda I have redone the steps and I can't reproduce the problem :/ Is it still there ? |
We had HMR break for us when upgrading to the Webpack 5 builder. After some troubleshooting we think we found it was caused by a circular dependency through Storybook. There were no obvious error messages other than the warning mentioned above. Our structure:
src/.storybook/preview.js
src/components/example.stories.tsx
src/index.ts
Our fix was to simply import the ThemeProvider directly instead of through the ./src/index.ts file. |
Had the same issue. I am developing a component library in Angular and I had this in preview.js
This enabled me to write composite stories and not needing to import and declare missing components in each individual story.
This is a bit annoying to have to do this for all the stories |
I'm having the same issue as @HarlesPilter: I'm using the addDecorator(
moduleMetadata({
imports: [SharedUiStorybookModule]
})
); While this works to render my component, it does not reload when I do changes to my component (it only reloads when I do changes inside my stories file). Reloading will work though when I add the export default {
title: 'Shared/Ui/LoadingBannerComponent',
component: LoadingBannerComponent,
decorators: [
moduleMetadata({
imports: [SharedUiStorybookModule]
})
]
} as Meta<LoadingBannerComponent>; But this is a bit cumbersome, because I would need to do this for all my |
I'm seeing the same issue with react. I recently just added a https://storybook.js.org/addons/storybook-addon-styled-components-themes Project structure:
decorators in import { ThemeProvider } from 'styled-components';
import { ThemesProvider } from 'storybook-addon-styled-component-theme';
// other stuff...
export const decorators = [
(story) => (
<ThemesProvider themes={themes} ThemeProvider={ThemeProvider}>
<GlobalStyles />
{story()}
</ThemesProvider>
),
];
|
Is this still an issue with the latest version of angular and storybook 7.0 beta? @nomadoda ? |
Describe the bug
Hot reloading fails in Angular 11 and the site is reloaded. I'm getting many of errors similar to this:
And eventually:
To Reproduce
npx -p @angular/cli ng new storybook-angular-10-hmr
npx -p @storybook/cli sb init
Or checkout this repository https://github.com/nomadoda/storybook-angular-10-hmr
yarn storybook
Expected behavior
HMR without any errors.
Screenshots
System
Additional context
Issues seem to appear with angular 10 & angular 11.
The text was updated successfully, but these errors were encountered: