question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

change rootDir to ./src cause trouble for storybook custom `/.storybook/config.ts` with require.context (Storybook <5.3)

See original GitHub issue

Current Behavior

after receiving the warning to tell me changge the rootDir to ./src, the stroybook does not work no longer.

ERROR in /Users/bytedance/workspace/use-pick-files/tsconfig.json
[tsl] ERROR
      TS6059: File '/Users/bytedance/workspace/use-pick-files/.storybook/config.ts' is not under 'rootDir' '/Users/bytedance/workspace/use-pick-files/src'. 'rootDir' is expected to contain all source files.

ERROR in /Users/bytedance/workspace/use-pick-files/tsconfig.json
[tsl] ERROR
      TS6059: File '/Users/bytedance/workspace/use-pick-files/stories/use-pick-files.stories.tsx' is not under 'rootDir' '/Users/bytedance/workspace/use-pick-files/src'. 'rootDir' is expected to contain all source files.

Expected behavior

storybook works after changing the rootDir

Suggested solution(s)

Additional context

Your environment

Software Version(s)
TSDX 0.13.0
TypeScript 3.8.3
Browser chrome
npm/Yarn yarn 1.21.1
Node 12.14.1
Operating System mac os

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
zhaoyao91commented, Mar 30, 2020

@agilgur5 thanks for help this is the original repo

1reaction
zhaoyao91commented, Mar 25, 2020

@agilgur5 confirmed, workaround works well! this may be integrated into the template of react with storybook, to avoid having to search the issue for new projects.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure Storybook
Configure Storybook. Storybook is configured via a folder called .storybook , which contains various configuration files. Note that you can change the folder ......
Read more >
TypeScript Config - Storybook
Setting up TypeScript to work with Storybook​​ We first have to use the custom Webpack config in full control mode, extending default configs...
Read more >
Error after upgrading TypeScript (3->4) and Storybook (5->6)
After upgrading TypeScript from 3.9.6 to 4.4.4 and Storybook from 5.3.19 to 6.5.10, I'm getting the following error in several files:
Read more >
err_ossl_evp_unsupported storybook - You.com | The AI ...
Finally, if you are unable to change the Webpack configuration (e.g., if it's a transitive ... yarn create vite // react-ts npx sb...
Read more >
Using Vite for Bandler in Storybook | miyauci.me
It shows you how to develop Storybook with Vite. Explains in detail the points where you can get stuck in a preact project....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found