3

I cloned a CRA repo and switched from npm to yarn. after running yarn start I am met with an error that says

[HPM] Missing "target" option. Example: {target: "http://www.example.org"}
error Command failed with exit code 1.

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Can't seem to find much info about a fix online

Dayvvo
  • 231
  • 1
  • 2
  • 8

1 Answers1

3

I had the same problem.

The problem was that some of the components were trying to access environment variables that did not exist. If this is the case, make sure that the .env file is present in the root of the project with the environment variables well defined.

For example:

// .env

REACT_APP_BACKEND_URL = http://localhost:3001
Oreol Noumodong
  • 141
  • 1
  • 1
  • 9