Skip to content

Instructions to add flow result in non-functional outcome #13188

@sberney

Description

@sberney

Describe the bug

When creating a new react app, exactly following the directions (1, 2) on the website does not work as expected. Running yarn flow produces an error.

Did you try recovering your dependencies?

I started from scratch.

Which terms did you search for in User Guide?

N/A

Environment

Environment Info:

  current version of create-react-app: 5.0.1
  running from /home/sam/.config/yarn/global/node_modules/create-react-app

  System:
    OS: Linux 5.15 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
    CPU: (8) x64 Intel(R) Xeon(R) CPU E5-1620 v4 @ 3.50GHz
  Binaries:
    Node: 16.13.2 - /tmp/yarn--1685069571431-0.9181355925999266/node
    Yarn: 1.22.17 - /tmp/yarn--1685069571431-0.9181355925999266/yarn
    npm: 8.1.2 - /nix/store/nwf4llpwqwmxbx38nwa1zvlhpnd956fg-nodejs-16.13.2/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    react: ^18.2.0 => 18.2.0 
    react-dom: ^18.2.0 => 18.2.0 
    react-scripts: 5.0.1 => 5.0.1 
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

nix-shell -p nodejs yarn
yarn create react-app test-react-app
cd test-react-app
yarn add flow-bin

# here, edit the package.json to include "flow": "flow"

yarn flow init
yarn flow

Expected behavior

Flow runs, and no problems are reported, since no files are tagged with // @flow and CRA claims to support flow out of the box.

Actual behavior:

Result

$ flow
Launching Flow server for /home/sam/tmp/test-react-app
Spawned flow server (pid=2092985)
Logs will go to /tmp/flow/zShomezSsamzStmpzStest-react-app.log
Monitor logs will go to /tmp/flow/zShomezSsamzStmpzStest-react-app.monitor_log
Error ┈┈┈┈┈┈ node_modules/eslint-plugin-react/node_modules/resolve/test/resolver/malformed_package_json/package.json:2:1

Unexpected end of input, expected the token }

     1│ {
     2│


Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/resolve/test/resolver/malformed_package_json/package.json:2:1

Unexpected end of input, expected the token }

     1│ {
     2│



Found 2 errors
error Command failed with exit code 2.

Reproducible demo

See steps.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions