Open danielritter opened 3 months ago
Can you try this again on latest Nx (v20)?
This issue has been automatically marked as stale because no results of retrying on the latest version of Nx was provided within 7 days. It will be closed in 21 days if no results are provided. If the issue is still present, please reply to keep it active. If the issue was not present, please close this issue. Thanks for being a part of the Nx community! 🙏
Current Behavior
I have a nx repo with storybook and tailwind configured (storybook-demo.zip). Within I have the following libraries created:
I have one file
badge.tailwind.ts
in@frontend/angular-ui-button
that imports two functions from@frontend/angular-ui-tailwind
.When I want to start
npm run storybook
I get the following error message:My tsconfig for storybook
tsconfig.storybook.ts
inlibs/frontend/angular/ui/storybook
looks like this:To resolve the
Error: Cannot find module
issue I tried to install theTsconfigPathsPlugin
plugin as mentioned here https://stackoverflow.com/questions/71677948/how-to-add-typescript-paths-to-storybook as follows in themain.ts
underlibs/frontend/angular/ui/storybook/src/lib/storybook
:I also tried to set the alias as mentioned here: https://storybook.js.org/docs/builders/webpack
In the
project.json
infrontend-angular-ui-storybook
I also tried to setimplicitDependencies
as mentioned here: https://nx.dev/recipes/storybook/one-storybook-for-all#extras-dependenciesThe references in
tsconfig.json
infrontend-angular-ui-storybook
are set as follows:With all this done, the error is still here and typescript cannot resolve the module
@frontend/angular-ui-tailwind
when starting storybook. When I remove the dependenciesimport { apply, createComponentPlugin } from '@frontend/angular-ui-tailwind';
inbadge.tailwind.ts
from@frontend/angular-ui-button
, storybook can be started.Expected Behavior
I can import functions from another package and run storybook without errors.
GitHub Repo
https://github.com/user-attachments/files/16458450/storybook-demo.zip
Steps to Reproduce
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
Tailwind
tailwind.config.ts
is configured inlibs/frontend/angular/ui/storybook
and imports there the pluginbadge.tailwind.ts
.