storybookjs/storybook

[Bug]: flow typecheck fails due to malformed_package_json

Open

#25,202 opened on Dec 12, 2023

View on GitHub
 (0 comments) (0 reactions) (0 assignees)TypeScript (10,058 forks)batch import
bugbuilder-webpack5compatibility with other toolshelp wanted

Repository metrics

Stars
 (89,909 stars)
PR merge metrics
 (Avg merge 7d 22h) (184 merged PRs in 30d)

Description

Describe the bug

Flow responds with an error when I upgrade storybook to the latest version.

To Reproduce

Run npx storybook@latest upgrade on a project that had storybook@7.6.3 to update the storybook to 7.6.4. This was also a problem when I ran that script to update storybook from 7.5.3 to 7.6.3.

Run npx flow.

Error message:

Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
node_modules/@storybook/preset-react-webpack/node_modules/resolve/test/resolver/malformed_package_json/package.json:2:1

Unexpected end of input, expected the token }

     1│ {
     2│



Found  1 error

System

ubuntu2004 and on a macbook pro with sonoma 14.1.2

Additional context

I looked up the file in the node_modules directory, and it just has a single open curly bracket.

Reverting @storybook/react-webpack5 to 7.5.3 resolves the flow error, but that package isn't kept in sync with the other storybook packages.

Running storybook locally works as expected with react-webpack5@7.6.4

Contributor guide