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
Angular / Storybook: styles.scss of the default project is used for all storybook configs #8255
Comments
I am also experiencing this issue. No matter what I use for browserTarget in angular.json, the defaultProject in nx.json is always used in the storybook build, which means any global styles (in the library's styles array in angular.json) are not applied. I haven't been able to find an adequate workaround yet (other than needlessly adding irrelevant stylesheets to the defaultProject's styles array. Any tips? |
Hi there! Thank you @CodeCakePie @joewIST for filing this issue! Can you try setting the --projectBuildConfig flag to the project you want the use the styles from when you're running/building Storybook, and let me know if your issue is resolved? eg.
or
|
btw, maybe a small adjustment in the codebase, and some documentation will land at some point in January to make this a bit clearer. |
Linking this for reference #8199 |
@mandarini yes that fixes things, thank you. i was unable to find any reference to this projectBuildConfig before |
That's great @joewIST ! I will go ahead and close this issue for now. If it ever comes up again, I'll make sure to open it up! :) Thank you! |
unfortunately i now get a new issue which means it can't even build at all: TypeError: getTypescriptWorkerPlugin is not a function |
@joewIST Ohh that's the Storybook Angular 13.1 bug! You should be good if you upgrade Storybook to the pre-release version, as mentioned here. |
hi @mandarini that does not fix things i'm afraid |
The " |
@mandarini https://github.com/storybookjs/storybook/releases/tag/v6.5.0-alpha.6 works |
hi @mandarini i have tried that solution and now get the following error: ModuleParseError: Module parse failed: Unexpected token (3:0) |
Hmmm I am worried that this may be on the Storybook side @joewIST ! Can you read through the above issue to see if there's anything reported that matches your case? |
i will have a look thanks, there seem to be so many issues re: storybook/nx/angular integration atm! |
Indeed.. We'll get there! :) |
@mandarini i'm going to try to investigate whatever storybook issues might be causing this and if i can't find anything i'll have to park this for now. i've already spent so much time trying to upgrade to angular v13 these last few weeks |
Sounds good @joewIST ! I am sorry I could not help you any further. We're all trying our best to fix these issues. I will post any potential updates here. Good luck! :) |
@mandarini If you want my opinion, it seems to me that it makes sense to downgrade to Angular 13.0 as a default version until storybook 6.5.0 is released, so that newly created projects work out of the box. However, I don't see any issues tweaking configs to be able to use the latest versions. It's time consuming for sure, but it pays off imo. |
Thanks @rfprod ! :) |
New docs for |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
After adding storybook-config to a library, the styles.scss of the default application (specified in nx.json) will be applied to all stories.
Expected Behavior
The storybook styling should be independent of any application styling
Steps to Reproduce
I have created an demo repository for easier reproduction
Environment
The text was updated successfully, but these errors were encountered: