angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Configuration 'proxy.config.json' could not be found in project with cli version 6.0.0-beta.6

Open ymcnicoll opened this issue 8 years ago • 11 comments

When serving content using ng serve -pc proxy.config.json

I get a error message like the following:

Configuration 'proxy.config.json' could not be found in project. Error: Configuration 'proxy.config.json' could not be found in project. at Architect.getTarget (d:\Projects\components\lob\node_modules@angular-devkit\architect\src\architect.js:114:23) at MergeMapSubscriber.architect.loadWorkspaceFromJson.pipe.operators_1.concatMap [as project] (d:\Projects\components\lob\node_modules@angular\cli\models\architect-command.js:56:45) at MergeMapSubscriber._tryNext (d:\Projects\components\lob\node_modules\rxjs\operators\mergeMap.js:122:27) at MergeMapSubscriber._next (d:\Projects\components\lob\node_modules\rxjs\operators\mergeMap.js:112:18) at MergeMapSubscriber.Subscriber.next (d:\Projects\components\lob\node_modules\rxjs\Subscriber.js:90:18) at MergeMapSubscriber.notifyNext (d:\Projects\components\lob\node_modules\rxjs\operators\mergeMap.js:145:30) at InnerSubscriber._next (d:\Projects\components\lob\node_modules\rxjs\InnerSubscriber.js:23:21) at InnerSubscriber.Subscriber.next (d:\Projects\components\lob\node_modules\rxjs\Subscriber.js:90:18) at Object.subscribeToResult (d:\Projects\components\lob\node_modules\rxjs\util\subscribeToResult.js:17:25) at MergeMapSubscriber._innerSub (d:\Projects\components\lob\node_modules\rxjs\operators\mergeMap.js:132:38)

but with version 6.0.0-beta.4 it all works fine.

Versions

6.0.0-beta.6

ymcnicoll avatar Mar 18 '18 13:03 ymcnicoll

I have also seen this issue after upgrading. If I move the proxy.conf.json file into src it works. I'd rather keep it in the root directory though if possible.

euangoddard avatar Mar 19 '18 11:03 euangoddard

moving it into src did not help for me

rtaft avatar May 08 '18 15:05 rtaft

issue seems to be that you can no longer use -pc, use --proxy-config

rtaft avatar May 08 '18 16:05 rtaft

Yes. CLI v6 now follows more standardized option parsing. -pc is the equivalent of -p -c. A note in the changelog should probably be added to mention this change.

clydin avatar May 08 '18 16:05 clydin

Follow the below steps, it helped me

i)create proxy.conf.json file under your project root instead of src folder ii) add this exactly in package.json under scripts "start": "ng serve --proxy-config proxy.conf.json" iii)do "npm start" instead of "ng serve"

stallurikinect avatar May 29 '18 00:05 stallurikinect

Oof. Thank you @rtaft Makes sense cause the standardization, but didn't even think about it since I've used --pc for every project.

@clydin A note for the 'update.angular.io' would be useful.

edit, or better yet have --pc display a deprecation note for a bit before full implementation

zbagley avatar Jun 06 '18 17:06 zbagley

Changing ng serve --proxy-config proxy.conf.js to ng serve --proxy-config=proxy.conf.js, solved my issue. NOTE: i use .js not .json file

fott1 avatar Jun 09 '18 14:06 fott1

Changing ng serve --proxy-config proxy.conf.js to ng serve --proxy-config=proxy.conf.js, solved my issue. NOTE: i use .js not .json file

ng serve --proxy-config=proxy.conf.json it worked! Thanks

sushobitha avatar Sep 20 '18 21:09 sushobitha

step 2 rename your folder " proxy.config.json " to " proxy.config.json " ---------------------------------------- then ------------------- step 3 change the path in " package.json " the line with " ng serve nproxy.conf.json --open " with " ng serve --proxy-config proxy.conf.json -o "

then you can run " yarn dev "

ChristianDanielMezieres avatar Dec 18 '18 17:12 ChristianDanielMezieres

@sushobitha thanks for sharing!

mgechev avatar Dec 18 '18 18:12 mgechev

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.