No luck getting Dev Wallet working

I followed the directions in the dev-wallet readme to the letter, several times over. When that didn’t work, I tried every combination of config settings imaginable. Yet I’ve had no luck getting this thing working. It seems to me like the dev-wallet isn’t actually communicating with the emulator.

I’m running Flow Emulator v0.29.0 (gRPC server port 3569, HTTP server port 8080). With this, I’m running the latest Docker image of dev-wallet with the following:

docker run -it ` -p 8701:8701 ` -e PORT=8701 ` -e FLOW_ACCESS_NODE=http://localhost:8080 ` -e FLOW_ACCOUNT_KEY_ID=0 ` -e FLOW_ACCOUNT_PRIVATE_KEY=84f82df6790f07b281adb5bbc848bd6298a2de67f94bdfac7a400d5a1b893de5 ` -e FLOW_ACCOUNT_PUBLIC_KEY=4519e9fbf966c6589fafe60903c0da5f55c5cb50aee5d870f097b35dfb6de13c170718cd92f50811cdd9290e51c2766440b696e0423a5031ae482cca79e3c479 ` -e FLOW_INIT_ACCOUNTS=0 ` -e FLOW_ACCOUNT_ADDRESS=0xf8d6e0586b0a20c7 ` -e FLOW_AVATAR_URL=https://avatars.onflow.org/avatar/ ` ghcr.io/onflow/fcl-dev-wallet:latest

The FLOW_ACCOUNT_PRIVATE_KEY, FLOW_ACCOUNT_PUBLIC_KEY, and FLOW_ACCOUNT_ADDRESS all match what’s in my flow.json file (and the emulator spits out these values when it starts up, confirming they are correct).

I then run a script to create test accounts on the emulator (I’ve also tried setting the FLOW_INIT_ACCOUNTS to a value > 0, which I presume will automatically create accounts for me?)

When I browse to localhost:8701, it redirects to /accounts where it shows my config settings. Under that, Accounts is blank. The browser console shows a request to localhost:8701/api/accounts that returned HTTP 500 Internal Server Error with an empty array for the response []

localhost:8701/fcl/authn also shows the same failed request to localhost:8701/api/accounts

Or, going to localhost:8701/harness, I try clicking Log In. The screen grays out before it says “Localhost refused to connect”

When I try my FCL test code, which uses localhost:8701/fcl/authn for discovery.wallet. When it calls fcl.authenticate(), it opens an iframe with the URL localhost:8701/authenticate but that comes back with a 404 error.

As I say, my config settings all match up. I’ve checked and double-checked. Any ideas what could be going on?

Found a solution, for anyone else that might have this problem. The issue is that inside the Docker container on my machine (Windows 10), localhost does not point to the host’s local address, so the dev-wallet could not connect to the emulator. The workaround was to set FLOW_ACCESS_NODE=http://host.docker.internal:8080

Also worth mentioning, after that I ran into an issue with the dev-wallet initialization (I’m not using the React quick start app). The dev-wallet was producing this error on the emulator:
"cannot find declaration FCL in f8d6e0586b0a20c7.FCL"

The solution was simply to browse to localhost:8080/api/init before using it. The dev-wallet stores its data on-chain, and won’t work until this initialization is done.