#TypeScript Namespace 'React' has no exported member 'SFC'.

6 messages · Page 1 of 1 (latest)

lone sparrow
#

After upgrading to Storybook I'm getting the error from TypeScript that 'React' has no exported member 'SFC'.

It's related to the markdown-to-jsx module:
../../node_modules/@types/markdown-to-jsx/index.d.ts

But I have absolutely no idea what is wrong.
I'm the only one in the project with the problem, and Google isn't helping.
We are not using React in the project.

I've tried deleting node_modules and doing a fresh install.

copper bluff
#

Can you share the output of npx sb info?

#

React SFC was removed in React 18 so i suspect there’s a type conflict due to that

#

You might try skipLibCheck: true in your tsconfig as a workaround

lone sparrow
#

This is the output of 'npx sb info':

Environment Info:

System:
OS: macOS 13.1
CPU: (8) arm64 Apple M1
Binaries:
Node: 16.15.0 - /usr/local/bin/node
Yarn: 1.22.18 - /usr/local/bin/yarn
npm: 8.5.5 - /usr/local/bin/npm
Browsers:
Chrome: 108.0.5359.124
Edge: 108.0.1462.54
Firefox: 108.0
Safari: 16.2
npmPackages:
@storybook/addon-a11y: ^6.5.14 => 6.5.15
@storybook/addon-actions: ^6.5.14 => 6.5.15
@storybook/addon-docs: ^6.5.14 => 6.5.15
@storybook/addon-essentials: ^6.5.14 => 6.5.15
@storybook/addon-links: ^6.5.14 => 6.5.15
@storybook/addon-notes: 5.3.21 => 5.3.21
@storybook/builder-webpack5: ^6.5.14 => 6.5.15
@storybook/html: ^6.5.14 => 6.5.15
@storybook/manager-webpack5: ^6.5.14 => 6.5.15
@storybook/mdx2-csf: ^0.0.3 => 0.0.3

#

But somehow, I'm actually not getting the error right now.
Don't know why exactly 😒