on a fresh “hello” project I get:
Error occurred while proxying request localhost:8080/api/v2/status to http://localhost:8000/ [ECONNREFUSED]
on the webpack server in a development environment. The canisters run fine on the replica and if I go directly to the replica i.e “localhost:8000/api/v2/status” it works, same with “127.0.0.1:8080/api/v2/status” and if I change the webpack proxy to “127.0.0.1” or change the dfx.json to start the replica on “localhost” everything works fine … I just did not have to do that in the past.
Anyone have any thoughts on this one? I have Mac M1 …
Hello Forum - FYI, I also posted this in the Dfinity Discord and @kpeacock (Kyle) from the Dfinity team said that this behavior was most likely from a newer version of node.js.
So, I had 17.2 active and he said the SDK supports 12, 14, and 16 …
I unlinked 17, installed 16 and linked it …
for those that use “brew” on a Mac, I did this:
brew install node@16
brew unlink node
brew link --overwrite --dry-run node@16
#just to check I ran the --dry-run ... my machine wanted an "--overwrite" to complete
brew link --overwrite node@16
then started dfx and web pack dev server and it worked as before.
This bug is now in a stable NodeJS release (18.12.1)
As previously mentioned, this issue occurs when using Node 18, but is fixed (does not occur) when using Node 16.
Is specific bug (in the post) with webpack, webpack plugins, or something else entirely? It would be nice to be able to spin up a dev-server without having to switch back to Node 16.
Additionally, it seems like there are a few agent-js features now (such as node compatibility flag and the native fetch implementation with createActor) that are using Node versions >= 18, so it might be time to fully support Node 18 :
I’m just now running into this issue with my app after adding a local ledger canister. I’ve replaced the localhost with 127.0.0.1 in my webpack config as well as binding that address as described in the thread linked by @paulyoung but I am unable to make calls or queries from my frontend canister to my backend canister, nor am I able to check the status at localhost:8080/api/v2/status. I’m able to make calls and queries to it from the console and Candid interface so I’m confused why it’s refusing connections from some actors.
This is using node 16.14.2