nx g @nrwl/angular:storybook-configuration [lib] should ignore modules without declarations arrays.
What is the current behavior?
Schematic fails if library contains modules without declarations array.
No declarations array in the @NgModule decorator in libs/[lib]/src/lib/[module].module.ts
Please provide detailed steps for reproducing the issue.
nx g @nrwl/angular:storybook-configuration [lib]Please provide any relevant information about your setup:
@nrwl/angular : 9.0.4
@nrwl/cli : 9.0.4
@nrwl/cypress : 9.0.4
@nrwl/eslint-plugin-nx : Not Found
@nrwl/express : Not Found
@nrwl/jest : 9.0.4
@nrwl/linter : Not Found
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/react : Not Found
@nrwl/schematics : Not Found
@nrwl/tao : 9.0.4
@nrwl/web : Not Found
@nrwl/workspace : 9.0.4
typescript : 3.7.5
No declarations array in the @NgModule decorator in libs/[lib]/src/lib/[module].module.ts
Adding an empty declarations array to the module solves the issue but it would be nice to not have to add empty declarations arrays to all of my routing modules.
Would somebody in the community be interested in taking a look? No stories should be produced for modules without declarations. Maybe a warning would be nice to explain why no stories were created.
Even when 'No' is chosen as option to generate the *.stories.ts files, the error occurs. I guess a warning should be shown as @FrozenPandaz mentions, when 'Yes' is chosen. If 'No' is chosen, I expect it to just add the .storybook directory without complaining or showing a warning at all.
The workaround posted by OP works, as an extra note: this has to be done for every module specified in the lib.

I am getting the same error No declarations array in the @NgModule decorator in libs/[lib]/src/lib/[module].module.ts
I am getting the same error No declarations array in the @NgModule decorator in libs/[lib]/src/lib/[module].module.ts
Add an empty declarations array to every module in that lib:
declarations: [ ]
Then run the generator again.
After it succesfully added the .storybook configuration, you can delete the empty arrays again.
Most helpful comment
Add an empty declarations array to every module in that lib:
declarations: [ ]Then run the generator again.
After it succesfully added the .storybook configuration, you can delete the empty arrays again.