Skip to content

Error When Running 'npm start' with Proxy Configuration #13372

@manoj633

Description

@manoj633

Describe the bug

I am encountering an error when running npm start in a Create React App-generated React frontend project. The error message is as follows:

Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options.allowedHosts[0] should be a non-empty string.

Did you try recovering your dependencies?

8.15.0

Which terms did you search for in User Guide?

proxy in the local environment

Environment

    OS: Windows 10 10.0.19045
    CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz    
  Binaries:
    Node: 16.17.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.15.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 116.0.5845.188
    Edge: Spartan (44.19041.1266.0), Chromium (117.0.2045.36)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    react: Not Found
    react-dom: Not Found
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

  1. Create a new Create React App-generated project.
  2. Set the proxy to "http://localhost:8800/" in the project configuration.
  3. Run the command npm start.

Expected behavior

I expected that the development server would start without any errors when running npm start.

Actual behavior

image

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