nx: storybook is failing: is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
My storybook is failing with the upgrade.
Can someone please check below and advise?
ModuleBuildError: Module build failed (from ./node_modules/@angular-devkit/build-angular/node_modules/@ngtools/webpack/src/ivy/index.js):
Error: /../src/lib/my-lib/my-test.stories.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at ../node_modules/@angular-devkit/build-angular/node_modules/@ngtools/webpack/src/ivy/loader.js:60:26
at processResult (../node_modules/@storybook/builder-webpack5/node_modules/webpack/lib/NormalModule.js:751:19)
at ../node_modules/@storybook/builder-webpack5/node_modules/webpack/lib/NormalModule.js:853:5
at ../node_modules/loader-runner/lib/LoaderRunner.js:399:11
at ../node_modules/loader-runner/lib/LoaderRunner.js:251:18
at context.callback (../node_modules/loader-runner/lib/LoaderRunner.js:124:13)
at ../node_modules/@angular-devkit/build-angular/node_modules/@ngtools/webpack/src/ivy/loader.js:60:17
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 45 (26 by maintainers)
@mandarini No worries, I figured it out. The path was incorrect for my project …/**/*.stories works for me. Thanks for the help!
including polyfill.ts in files worked for me!. thank you so much for helping all the way!!
Thanks @mandarini
I have added the following configuration in my package json
"resolutions": { "webpack": "^5.68.0" }this solved the above error.
but now, I am getting the following error,
webpack built preview 4c6ff73840e0d7fdbc84 in 77758ms ModuleBuildError: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): Error: /Users/apps/my-app/src/polyfills.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. at /Users/node_modules/@ngtools/webpack/src/ivy/loader.js:60:26 at processResult (/Users/node_modules/webpack/lib/NormalModule.js:753:19) at /Users/node_modules/webpack/lib/NormalModule.js:855:5 at /Users/node_modules/loader-runner/lib/LoaderRunner.js:399:11 at /Users/node_modules/loader-runner/lib/LoaderRunner.js:251:18 at context.callback (/Users/node_modules/loader-runner/lib/LoaderRunner.js:124:13) at /Users/node_modules/@ngtools/webpack/src/ivy/loader.js:60:17Can you please advise on this?
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!
I’m closing this issue, since it seems that if you add the missing files in
tsconfig.jsonfixes it. If issue persists @dean-g , let me know and I can reopen!@ewalddieser let me know about the issue you’re having!
@mandarini Yes
.../../../**/*.stories.*works! Thank you so much genius!It still does not work if you add the
*.stories.*pattern?Yes, it works. but when you have node lib it doesn’t, because it’s throw node errors. I also check about .stories.
@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:
let me work on recreating this issue with the new folder structure
something wrong with the following setups: stories: [
../../my-project/stories/my-lib/**/*.stories.@(ts|mdx)]**/*not working seems -> storybook is not going through the nested folder!. it only picks up the current directory which is my-lib for my caseHi there @dean-g ! Thanks for filing an issue!
Can you please:
nx reportand paste it here?storybookandbuild-storybooktargets? They are both in your project’sproject.jsonfilenx storybook my-lib --projectBuildConfig=my-lib:build-storybookand let me know if it worked?