parcel: Proxy doesn't appear to be running/working on 2.0, Mac OSX 12.0.1
π bug report
In an attempt to run the devserver + proxy, it seems the proxy isnβt running? Or at least not functioning as expected?
I followed the instructions at https://parceljs.org/features/development/ and it seems to me that this rule should proxy . As authored it works on a linux OS, but not on my mac os x machine.
π Configuration (.babelrc, package.json, cli command)
.proxyrc
{
"/api": {
"target": "http://localhost:8080/"
}
}
π€ Expected Behavior
http://localhost:1234/api -> http://localhost:8080/api
curl http://localhost:1234/api/endpoints
{ "some": "json content served at http://localhost:8080/api/endpoints"}
π― Current Behavior
the call currently returns the contents of http://localhost:1234.
I also used a linux machine I have, same node, npm, parcel versions. The proxy appears to be working on that machine, this may be OS X specific.
| Software | Version(s) |
|---|---|
| Parcel | 2.0.0 and 2.0.1 |
| Node | 16.13.0 |
| npm/Yarn | 8.1.0 |
| Operating System | Mac OS X v12.0.1 |
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 17 (7 by maintainers)
I am seeing something like this in a project with Yarn/npm
workspaces. I am using Parcel in only one workspace (so far) but it was installed by Yarn in the rootnode_modulesfolder.On a hunch (off of @mischnicβs comment about global vs. local), I tried moving the
.proxyrcfile to the root next to thenode_moduleswhere it is installed, and now the proxy is working as expected.You need to do
curl http://localhost:1234/api/datato request this file: https://github.com/mischnic/parcel-issue-7257/blob/master/api/data