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:\Projectscomponents\lobnode_modules\@angular-devkit\architect\src\architect.js:114:23)
at MergeMapSubscriber.architect.loadWorkspaceFromJson.pipe.operators_1.concatMap [as project] (d:\Projectscomponents\lobnode_modules\@angularcli\models\architect-command.js:56:45)
at MergeMapSubscriber._tryNext (d:\Projectscomponents\lobnode_modules\rxjs\operators\mergeMap.js:122:27)
at MergeMapSubscriber._next (d:\Projectscomponents\lobnode_modules\rxjs\operators\mergeMap.js:112:18)
at MergeMapSubscriber.Subscriber.next (d:\Projectscomponents\lobnode_modules\rxjs\Subscriber.js:90:18)
at MergeMapSubscriber.notifyNext (d:\Projectscomponents\lobnode_modules\rxjs\operators\mergeMap.js:145:30)
at InnerSubscriber._next (d:\Projectscomponents\lobnode_modules\rxjs\InnerSubscriber.js:23:21)
at InnerSubscriber.Subscriber.next (d:\Projectscomponents\lobnode_modules\rxjs\Subscriber.js:90:18)
at Object.subscribeToResult (d:\Projectscomponents\lobnode_modules\rxjs\util\subscribeToResult.js:17:25)
at MergeMapSubscriber._innerSub (d:\Projectscomponents\lobnode_modules\rxjs\operators\mergeMap.js:132:38)
but with version 6.0.0-beta.4 it all works fine.
6.0.0-beta.6
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.
moving it into src did not help for me
issue seems to be that you can no longer use -pc, use --proxy-config
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.
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"
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
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_
Changing
ng serve --proxy-config proxy.conf.jstong 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
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 "
@sushobitha thanks for sharing!
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._
Most helpful comment
Changing
ng serve --proxy-config proxy.conf.jstong serve --proxy-config=proxy.conf.js, solved my issue. _NOTE: i use .js not .json file_