-
Notifications
You must be signed in to change notification settings - Fork 2.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
storybook is failing: is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. #8676
Comments
Hi there @dean-g ! Thanks for filing an issue! Can you please:
|
Hello @mandarini Thanks for looking into my issue!. Please find below, nx report:
Project configuration:
Upgraded from: nx storybook my-lib --projectBuildConfig=my-lib:build-storybook Here is the response I got,
|
Hi there @dean-g ! What is your library's name? From your project configuration you pasted above, I can infer that it is
Can you try that? If that fails as well, can you please send me a repository reproducing your issue so that I can look into it? Or, can you at least show me the folder structure of your workspace? Also, please take a look at our updated projectBuildConfig for Storybook+Angular documentation. |
Here is what happens when I run
this is somehow related to the following error: storybookjs/storybook#17039 looks like they had a fix in webpack files. Can you please check nrwl users the latest storybook changes for angular 13.1 upgrade? |
Hello @mandarini I never had an issue running a storybook. it started well but later throw an error with the following message for all my stories,
|
few of my stories are running fine. I have an issue only with the deeply nested folder stories FAIL: SUCCEEDED:
Here is my tsconfig looks like:
Please advise if anything missing on include section |
Hi @dean-g ! Thanks for the information. The stories are linked inside your |
|
I see. And this was generated by Nx? I am having a bit of trouble understanding your folder structure. Can you please create a reproduction repo with a similar folder structure? Does the path linking the Also, if you think that it's related to storybookjs/storybook#17039, have you tried the steps suggested there? Did they work for you? |
@mandarini my configuration works very well with the following version nrwl package: 13.2.2 the same setup is not working with 13.1.x and above. Is there something changed for the storybook that causes this issue? |
Hi @dean-g, thanks for following up! Don't worry, we'll solve this issue, together :) I'll help you out! Yes, lots of things changed both on Angular 13.1, and on the corresponding Storybook side. Can you please share at least how your folder structure looks like, so that I understand where |
something wrong with the following setups:
|
let me work on recreating this issue with the new folder structure |
Perfect, I'll wait for the repro! Thank you @dean-g ! :) |
@mandarini I can confirm this error because I got it too. https://github.com/wizardnet972/nx-storybook-compilation (Below is how to reproduce the problem.)
Here is how to reproduce the problem:
nx report:
|
Hi, I'm also having this problem. Is it perhaps related to following issues? storybookjs/storybook#17039 Everything used to work fine, I get this error after the latest update of NX+Angular. |
Hi @wizardnet972 @dean-g ! I just got around into looking at this issue more carefully, and using your reproduction steps @wizardnet972 . I am sorry, but I think the error makes sense. Did you try adding the files in the tsconfig via the 'files' or 'include' property? When I did the following (just added the path in the project's Storybook
And to me it makes sense. We are referencing an external story in our |
@ewalddieser I think you may be having a different issue, since the issues you posted here are not really related to our case (our case is about external/nested stories). |
Let me know if this does the trick @wizardnet972 @dean-g , and I will go ahead and close this issue. @ewalddieser you can open a new issue describing the exact problem you're facing, if you want, or post it here and I will look into it! Thank you all, and thanks for providing so many details! :) |
@wizardnet972 here is my repo of the steps you posted, and a commit showing the small changed that fixed it! |
@mandarini the idea of including the other stories from other libs came from this nx video: https://youtu.be/c323HOuFKkA?t=150 I try to change the tsconfig.json to include everything in the compilation as you wrote: the change of the tsconfig throws an error:
|
@wizardnet972 what if you change it to
Looking at the video now! It's perfectly valid to include other stories :) |
Oh, yes, I see this video uses the old config files of Storybook (eg. I still think that it makes sense to include the path in the Storybook's Let me know if this makes sense! :) |
I updated my repo to include the new path. It should work, right? I mean, it works for me... |
Yes, it works. but when you have node lib it doesn't, because it's throw node errors. I also check about .stories. |
It still does not work if you add the |
@mandarini Yes |
Hahahah :) |
I'm closing this issue, since it seems that if you add the missing files in @ewalddieser let me know about the issue you're having! |
Thanks @mandarini I am getting the different errors now Please see the following,
|
fixed the above issue. getting one final issue with the scss file, Please find below and advise,
|
@dean-g Also, where do you import |
Btw, @wizardnet972 , you can combine stories etc using Storybook Composition! Please take a look at our docs, this may help with your usecase! |
I got the stylePreprocessorOptions setups in my angular.json file. so I can import the library directly instead of the full file path. here is the configuration that used to works well,
|
I moved the stylePreprocessorOptions to build-storybook and it worked!. Now the angular material styles are not working in my storybook but the build got succeeded. also, the asset is not loading. getting 404 error |
I am getting the following error now when I updated "projectBuildConfig" to use the main project where we had the asset and scss setups, Please check and advise
|
Hi @dean-g ! Thanks for this. This is a separate issue, which I think is related to Storybook. Check out this comment as well. If these are not helpful, I suggest you open a new issue on the Storybook side, or a new issue here with this new problem! I am really really sorry that you are having a bad experience at the moment, and I hope we manage to sort this out soon, and get you unblocked! |
Thanks @mandarini I have added the following configuration in my package json
this solved the above error. but now, I am getting the following error,
Can you please advise on this? |
including polyfill.ts in files worked for me!. thank you so much for helping all the way!! |
Perfect!!! :) :) The reason you get the polyfill.ts issue is that you're using the |
This issue doesn't seem to be fixed for me. I've got a project using nx, a shell, and different libraries that all have their own .storybook folder with tsconfig. If I add the include paths mentioned above to the tsconfig in .storybook folder of the lib, and the tsconfig of the lib, shell and tsconfig.base that is extended by all others the errors still persist |
Hi @d43vid ! Thanks for replying here! Can you please provide me with a small reproduction repository, so that I can better help you out, and see what's wrong? |
@mandarini No worries, I figured it out. The path was incorrect for my project ../**/*.stories works for me. Thanks for the help! |
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. |
My storybook is failing with the upgrade.
Can someone please check below and advise?
The text was updated successfully, but these errors were encountered: