Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Dont resolve paths from tsconfig #71

Closed
StephanAksenchenko opened this issue Apr 14, 2022 · 3 comments · Fixed by #83
Closed

Dont resolve paths from tsconfig #71

StephanAksenchenko opened this issue Apr 14, 2022 · 3 comments · Fixed by #83
Labels

Comments

@StephanAksenchenko
Copy link

Describe the bug

Nextjs automatically support tsconfig's paths and base url while addon add only root path to module resolution.

export const configureAbsoluteImports = (baseConfig: WebpackConfig): void => void baseConfig.resolve?.modules?.push(path.resolve()) here

Your minimal, reproducible example

https://github.com/StephanAksenchenko/Sb-addon-next-bug

Steps to reproduce

  1. use node 16.14.0
  2. yarn
  3. yarn dev // run development server and it works right
  4. yarn storybook // get exception about module resolution

Expected behavior

I expect it should work identically

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

Os - linux
Node - 16.14.0

storybook-addon-next version

v 1.6.2

Additional context

No response

@rosman83
Copy link

Experiencing this same issue

@RyanClementsHax
Copy link
Owner

Oh thanks for pointing this out! I appreciate the time you took to fill out an issue. Do you have a good workaround available that you could share?

For anyone stumbling on this issue. I believe using tsconfig-paths-webpack-plugin and configuring it as shown in the issue link below should be the preferred workaround.

I'll get this integrated into this package soon. (My wife and kid are both sick right now so I've been taking care of them lately. They should be better soon though.) Thanks for your patience.

https://www.npmjs.com/package/tsconfig-paths-webpack-plugin

storybookjs/storybook#3291 (comment)

@github-actions
Copy link

🎉 This issue has been resolved in version 1.6.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants