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.

"Import type" stopped working in "@nrwl/react": "14.7.6" for storybook

See original GitHub issue

Current Behavior

After updating to “@nrwl/react”: “14.7.6” from “@nrwl/react”: “14.7.5” and trying to run storybook I started to get an error in “import type” smth.

Expected Behavior

Storybook runs as normal, no errors. It is regression

Steps to Reproduce

  1. use import type in some storybook file
  2. update @nrwl/react from 14.7.5 to 14.7.6 (14.7.9 still broken)
  3. start storybook
  4. get this error specified in failure logs

example repo https://github.com/artra/nx-storybook-error nx serve smth:storybook to reproduce

Failure Logs

Unexpected token, expected "from" (9:12)
   7 |     var __LOCATIONS_MAP__ = {"AccountDetailsStory":{"startLoc":{"col":64,"line":11},"endLoc":{"col":102,"line":11},"startBody":{"col":64,"line":11},"endBody":{"col":102,"line":11}}};
   8 |
>  9 | import type { Story, Meta } from '@storybook/react';

Environment

Storybook

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:4
  • Comments:23 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
mandarinicommented, Sep 29, 2022

I’m looking into this today, if I don’t figure it out let’s open another bug. I’ve narrowed down the problem, the title does not depict it correctly!

1reaction
Tirkecommented, Sep 27, 2022

@mandarini I’m facing the same issue and I can’t remove @nrwl/react/plugins/storybook from the addons because when I do it all my imports declared in my tsconfig files stop working (eg Module not found: Error: Can't resolve '@front/components/inputs' ...)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't import module with typescript alias in storybook for react ...
I'm creating a mobile app with TypeScript , React Native , and Storybook . A storybook code can import another component something like ......
Read more >
@nrwl/next: Versions | Openbase
misc: do not exit after running graph (#12189) (3bf3a55) ... angular: add types to the generated tailwind configuration (#12018) (730d323) ... 14.7.6-beta.7.
Read more >
nx - bytemeta
nx not working after nx reset (NX Daemon process terminated and closed the ... "Import type" stopped working in "@nrwl/react": "14.7.6" for storybook....
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