Closed hviagov closed 2 years ago
Hey @hviagov ! Thanks for reporting this issue!
Taking a quick over your declarations:
import { NgModule } from '@angular/core';
import { PolicySliderComponent } from 'app/features/policy/elements/policy-slider/policy-slider.component';
import { PolicyCheckboxComponent } from 'app/features/policy/elements/policy-checkbox/policy-checkbox.component';
import { PolicyComponent } from 'app/features/policy/policy.component';
import { PolicyPopupComponent } from 'app/features/policy/elements/policy-popup/policy-popup.component';
import { SharedModule } from 'app/shared/shared.module';
@NgModule({
imports: [SharedModule],
declarations: [PolicyComponent, PolicyPopupComponent, PolicySliderComponent, PolicyCheckboxComponent],
exports: [PolicyComponent, PolicyPopupComponent, PolicySliderComponent, PolicyCheckboxComponent],
})
export class PolicyModule {}
These import paths seem to be incorrect, in particular, this syntax:
'app/features/policy/elements/policy-checkbox/policy-checkbox.component'
I know this is an alias to the root of the app, but this will conflict with many things, not just the generators.
It would be better to use relative import paths within the apps/<app-name>
folders.
If you're worried then about managing relative import paths (which can get messy), then it would make sense to extract these features (such as policy) into its own workspace library in Nx.
This would mean you could refactor your import to:
import { PolicySliderComponent, PolicyCheckboxComponent, PolicyComponent, PolicyPopupComponent } from '@frogile/policy';
Ignoring this, if you could try change your imports in your app to use relative imports, then attempt to run the generator again, can you check if you have any further success?
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏
I'm going to close this as there has been no updates in quite some time.
If anything changes, I'll readdress this.
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
Trying to generate stories for app components is landing into error like this one:
Here is my module declaration
and app tsconfig.json
Expected Behavior
Generating stories for single components persisting imports using path aliases
Steps to Reproduce
Assign path aliases in app's tsconfig.json and then import the component in the corresponding module using this alias
Failure Logs
See above
Environment
NodeJs: 16.4.2LTS Nx: 14.1.6 Angular: 13.2.2 OS: Linux 5.4.0-110-generic #124-Ubuntu SMP Thu Apr 14 19:46:19 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux