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

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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 24 (16 by maintainers)

Most upvoted comments

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!

@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' ...)