Skip to content

Added @ import to Webpack config, without needing a package#23020

Merged
jonniebigodes merged 8 commits into
storybookjs:nextfrom
noviceGuru:next
Jun 26, 2023
Merged

Added @ import to Webpack config, without needing a package#23020
jonniebigodes merged 8 commits into
storybookjs:nextfrom
noviceGuru:next

Conversation

@noviceGuru
Copy link
Copy Markdown
Contributor

Added @ import

It is the default in NextJS 13 and was not supported by storybook, while I was using it. The way I added it didn't need package to be installed or used

Corrected the type error in config.resolve

Since config.resolve can be undefined, using config.resolve.extensions ran into TypeScript error. by adding a condition to the beginning of the line, I got rid of the TS Error.

Worth to mention

I have a greenfield project in hand, using NextJS13. After adding Storybook for the first components, I ran into an error, that Storybook didn't recognize @ imports that are default in NextJS13.
The solution in the documentation didn't work for me, while the one I added worked just fine.

@jonniebigodes jonniebigodes self-assigned this Jun 11, 2023
@jonniebigodes jonniebigodes added documentation patch:yes Bugfix & documentation PR that need to be picked to main branch labels Jun 11, 2023
Copy link
Copy Markdown
Contributor

@jonniebigodes jonniebigodes left a comment

Choose a reason for hiding this comment

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

@noviceGuru, thanks for taking the time to put together this pull request and help us improve the documentation. Appreciate it 🙏 ! From my end, I left a couple of items that require your attention so that we can merge this.

Additionally, while you're making the changes, do you mind checking the snippets, as they're failing the pretty-docs job to address it requires that you run the yarn pretty-docs script before committing.

Also, thanks for providing some additional context, and with that, I'm going to loop in a fellow maintainer that worked on the Next.js integration and see if this requires an additional pull request for the Next.Js framework documentation to factor in your issue. Sounds good?

@valentinpalkovic can you chime in on this when you have a moment? Appreciate it.

Comment thread docs/snippets/common/storybook-main-ts-module-resolution.ts.mdx Outdated
Comment thread docs/builders/webpack.md Outdated
noviceGuru and others added 3 commits June 13, 2023 16:37
Description for aliasing configuration imporved, and type correction that was added to TS example, was added to JS version for accuracy and consistency.
Copy link
Copy Markdown
Contributor

@jonniebigodes jonniebigodes left a comment

Choose a reason for hiding this comment

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

@noviceGuru one small item for you that you left out. And apologize for not mentioning it earlier. Let me know once you've addressed it and I'll merge it.

Comment thread docs/builders/webpack.md Outdated
@jonniebigodes jonniebigodes merged commit 829c084 into storybookjs:next Jun 26, 2023
@github-actions github-actions Bot mentioned this pull request Jun 26, 2023
12 tasks
JReinhold pushed a commit that referenced this pull request Jun 26, 2023
Added `@` import to Webpack config, without needing a package

(cherry picked from commit 829c084)
@github-actions github-actions Bot mentioned this pull request Jun 26, 2023
18 tasks
JReinhold pushed a commit that referenced this pull request Jun 26, 2023
Added `@` import to Webpack config, without needing a package

(cherry picked from commit 829c084)
JReinhold pushed a commit that referenced this pull request Jun 27, 2023
Added `@` import to Webpack config, without needing a package

(cherry picked from commit 829c084)
JReinhold pushed a commit that referenced this pull request Jun 27, 2023
Added `@` import to Webpack config, without needing a package

(cherry picked from commit 829c084)
JReinhold pushed a commit that referenced this pull request Jun 27, 2023
Added `@` import to Webpack config, without needing a package

(cherry picked from commit 829c084)
JReinhold pushed a commit that referenced this pull request Jun 27, 2023
Added `@` import to Webpack config, without needing a package

(cherry picked from commit 829c084)
@JReinhold JReinhold added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jun 27, 2023
@ndelangen ndelangen removed the patch:yes Bugfix & documentation PR that need to be picked to main branch label Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation patch:done Patch/release PRs already cherry-picked to main/release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants