Closed kaichaosun closed 3 months ago
@kaichaosun Thanks!
How is this meant to be used? I have tried
VITE_SERVICE_ENDPOINT=http://someurl.com npm run dev
and
export VITE_SERVICE_ENDPOINT=http://someurl.com
npm run dev
But when I check in settings I still see the old hardcoded one.
You can set the .env with a default one, and override the .env if needed.
You can set the .env with a default one, and override the .env if needed.
Yes, my question is how to override it. With the example I shared above is not overridden. How can I override it?
It works with my machine with this command VITE_SERVICE_ENDPOINT=127.0.0.2 npm run dev
@kaichaosun I found the issue, would say it's a bug.
The first time one connects to the frontend, you provide a username. That's saved in localStorage
but also apiEndpoint
is saved. This means that when getItem("apiEndpoint")
is called, you are reloading the old endpoint and the env variable VITE_SERVICE_ENDPOINT
is ignored.
Mind having a look into this issue?
localStorage apiEndpoint
is set when user clicks save settings.
If you don't want this feature, just remove the button here https://github.com/threeproto/ferry-chat/blob/main/src/App.tsx#L27. I don't exactly know what's the expected way in waku-frontend, so feel free to do any changes you feel comfortable.
Fixed by #33
Fix https://github.com/waku-org/waku-frontend/issues/30