Storybook: TypeScript regression in 6.0.0-rc.22

Created on 3 Aug 2020  路  5Comments  路  Source: storybookjs/storybook

Describe the bug
rc.22 gives "impossible to import loader for .ts" error.

To Reproduce
Steps to reproduce the behavior:

  1. Clone my minimum working example at https://github.com/nareshbhatia/react-component-mwe. This has dependencies set to rc.21.
  2. Run the example (yarn then yarn storybook). Storybook should start and show one component.
  3. Change the dependency to rc.22 and run again.
  4. You will see the following error:
$ start-storybook -p 6006
info @storybook/react v6.0.0-rc.22
info
WARN => File /Users/naresh/projects/react-component-mwe/.storybook/main.ts is detected
WARN    but impossible to import loader for .ts
info => Loading presets
WARN => File /Users/naresh/projects/react-component-mwe/.storybook/main.ts is detected
WARN    but impossible to import loader for .ts
info => Loading presets
info => Loading config/preview file in "./.storybook".
info => Using default Webpack setup.
webpack built a35bf5650e72217f6be8 in 4648ms

Expected behavior
TypeScript project should run without any errors.

System:

Environment Info:

  System:
    OS: macOS 10.15.6
    CPU: (4) x64 Intel(R) Core(TM) i5-7600K CPU @ 3.80GHz
  Binaries:
    Node: 12.18.2 - ~/.nvm/versions/node/v12.18.2/bin/node
    Yarn: 1.22.4 - ~/.yarn/bin/yarn
    npm: 6.14.6 - ~/.nvm/versions/node/v12.18.2/bin/npm
  Browsers:
    Chrome: 84.0.4147.105
    Safari: 13.1.2
  npmPackages:
    @storybook/addon-essentials: 6.0.0-rc.21 => 6.0.0-rc.21
    @storybook/addons: 6.0.0-rc.21 => 6.0.0-rc.21
    @storybook/react: 6.0.0-rc.21 => 6.0.0-rc.21
bug configuration dependencies has workaround tracked typescript

All 5 comments

Thanks @nareshbhatia I'm able to repro.

The problem is due to #11759, which moved a few Vue-related dependencies out of addon-docs. After the upgrade you can see that @babel/register is no longer present in yarn.lock.

As a workaround, I added it back and that fixed the problem:

yarn add @babel/[email protected] --dev

I'm not sure what is the correct fix here, and will follow up with the team. cc @yannbf @ndelangen @tmeasday @tooppaaa

I'm just confused by this: the change in the mentioned PR doesn't change anything relating to @babel/register?

@shilman I can confirm that the adding of @babel/register works, but also have no idea why there is no change in yarn.lock regarding @babel/register. Also don't think that adding a dependency to make storybook work is not a correct fix. It should go directly to the package IMHO.

@ajkl2533 that's why i said it's a workaround

Yay!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.1 containing PR #11885 that references this issue. Upgrade today to try it out!

Closing this issue. Please re-open if you think there's still more to do.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bpeab picture bpeab  路  70Comments

ChucKN0risK picture ChucKN0risK  路  74Comments

joeruello picture joeruello  路  79Comments

43081j picture 43081j  路  61Comments

ilyaulyanov picture ilyaulyanov  路  100Comments