Problem Description:
https://github.com/facebook/create-react-app/issues/11762#issue-1080972271
i.e.
Set the proxy in package.json, and then start the project through npm start or yarn start, the error is as follows:
>yarn start
yarn run v1.22.10
$ react-scripts start
Attempting to bind to HOST environment variable: test.localhost
If this was unintentional, check that you haven't mistakenly set it in your shell.
Learn more here: https://cra.link/advanced-config
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.
error Command failed with exit code 1.
Solution: Don’t set the proxy in package.json, but set it in src/setupProxy.js, and delete the proxy in package.json, and finally restart npm start.
Read More:
- Vue Project Error: Proxy error: Could not proxy request [How to Solve]
- proxy error: could not proxy request [How to Solve]
- [Solved] Vue Start Project Error: ValidationError: webpack Dev Server Invalid Options
- [Solved] proxy Configure Error: Error occured while trying to proxy to:
- [Solved] NPM Start Project Error: ‘Error: error:0308010C:digital envelope routines::unsupported’
- [Solved] Vue Project Start Error: Support for the experimental syntax ‘jsx‘ isn‘t currently enabled
- [Solved] start value has mixed support, consider using flex-start instead
- [Solved] npm run start Run Error: Missing script: “start“
- How to Solve Vue add element Install Error
- React project is packaged and set as required Error [How to Solve]
- [Solved] npm run start Error: Exit status 3221225477
- [Solved] Vue Project startup error: no eslint configuration found
- [Solved] Vue-cli Create Project Error: ERROR command failed: yarn
- How to Solve Vue project Startup Error (Node Upgrade issue)
- Vue Start Error: This relative module was not found:
- [Solved] Git Error: fsmonitor–daemon failed to start
- [Solved] electron project Package Error: spawn exe\dll ENOENT
- The vue3 project Error: Cannot find module’vue-loader-v16/package.json’
- [Solved] Error spawn CMD enoent errno when starting Vue project: – 4058
- VScode vue3 Project vetur Error [How to Solve]