marshalhayes/RemixRunDotNet

Missing "target" option error when doing npm run dev

ledpup opened this issue · 1 comments

ledpup commented

I just downloaded this app to try it out. I get the following error after npm run dev. Prior to that I did npm install. Can't find mucha about it online. A missing .env file maybe?

RemixRunDotNet-main\src\WebApp\RemixApp\node_modules\http-proxy-middleware\dist\config-factory.js:38
throw new Error(errors_1.ERRORS.ERR_CONFIG_FACTORY_TARGET_MISSING);
^
Error: [HPM] Missing "target" option. Example: {target: "http://www.example.org"}
at createConfig (C:\Users\Patrick\Downloads\RemixRunDotNet-main\src\WebApp\RemixApp\node_modules\http-proxy-middleware\dist\config-factory.js:38:15)

I doubt you still need help figuring this out, but this is likely due to the environment variable BACKEND_URL not being set. See here.

This environment variable should be set to where you want the requests to /api/* to proxy to. When you run the .NET project, this environment variable is set automatically here.

As a side note, you shouldn't have to run npm or yarn independently of the .NET project.