Skip to content

Fix: alias error while running storybook#142

Merged
harshith-venkatesh merged 1 commit intodevelopfrom
Fix--Path-Alias-Error-in-Storybook
Apr 14, 2023
Merged

Fix: alias error while running storybook#142
harshith-venkatesh merged 1 commit intodevelopfrom
Fix--Path-Alias-Error-in-Storybook

Conversation

@samyakshah3008
Copy link
Copy Markdown
Contributor

@samyakshah3008 samyakshah3008 commented Apr 14, 2023

What is the change?

While running a storybook, server was not started with error message of "ModuleNotFoundError" as we have not configured path Alias in Storybook. In this PR, I have configured Storybook to resolve path alias.

This PR closes issue ticket #138

Before Change Screenshots

image

After Change Screenshots

image

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
website-calendar ✅ Ready (Inspect) Visit Preview Apr 14, 2023 11:27am
website-calendar-83va ✅ Ready (Inspect) Visit Preview Apr 14, 2023 11:27am

webpackFinal: async (config) => {
config.resolve.alias = {
...config.resolve.alias,
'~': path.resolve(__dirname, '../app'),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit pick:
There is a general practise of using @ instead of ~ for path alias.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samyakshah3008 Has this been considered as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use @ then we need to change it everywhere in our codebase where we have used ~
Shall I do it in this PR? @harshith-venkatesh @iRohitGaur ? Your thoughts?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be a one-time Change I feel should not be a problem.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider it as it is application level change

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great in that case, please go ahead and create a ticket linking this PR as well and mention the expectations of that ticket.
We can assign the ticket to the beginner as well :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*issue

Copy link
Copy Markdown
Contributor

@yesyash yesyash Apr 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but that also means all the files of story book in the application might be affected right. Might there be a chance, due to this condition, few components might not work right in story book?

Disagree here, if the paths are set right there will not be any problem as I have done this before.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I got confused with the intent of the ticket and its impact which had led to this discussion.
Thanks for providing more clarity @yesyash @samyakshah3008

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great, I have raised a ticket #143 @harshith-venkatesh @yesyash 😄
Thanks @yesyash for bringing out this discussion!

Copy link
Copy Markdown
Contributor

@harshith-venkatesh harshith-venkatesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the comment of yash, rest looks good.

webpackFinal: async (config) => {
config.resolve.alias = {
...config.resolve.alias,
'~': path.resolve(__dirname, '../app'),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samyakshah3008 Has this been considered as well?

@harshith-venkatesh
Copy link
Copy Markdown
Contributor

Great work with this PR @samyakshah3008 , please ensure the issue is created and mention about this PR as well.
I would go ahead and merge this PR

@harshith-venkatesh harshith-venkatesh merged commit 8c01fa5 into develop Apr 14, 2023
@harshith-venkatesh harshith-venkatesh deleted the Fix--Path-Alias-Error-in-Storybook branch April 14, 2023 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants