FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
120 stars 18 forks source link

Dev Enviroments not working at Run mode sessions #3910

Open Rasochii opened 1 week ago

Rasochii commented 1 week ago

Can we access your project?

Current Behavior

I'm using "Dev Enviroments" in a project as a way to differentiate urls from production and approval APIs. When running in "Test mode" the "apiUrl" variable that I use works with the url that I entered, but in "Run mode" this variable is empty and my requests end up not working.

Expected Behavior

I hope to be able to use "Dev Enviroments" regardless of whether it is "Run mode" or "Test mode". I also hope it works in deployment cases.

Steps to Reproduce

  1. Start a "Run mode"

  2. Open DevTools and look at Network

  3. Enter the following data in the "CPF" and "Senha" (Password) fields: 544.250.170-05 and 123

  4. Click on the green button labeled "Entrar" to try to log in

  5. View the request url. It will be empty where the apiUrl should be

Reproducible from Blank

Bug Report Code (Required)

IT40i/Hq3ItOocsA7qXxbflFmiA5KW4lUIInjtVRaCosfZT2BLMcec/RVERtZ9PgTUFqJGD8v2oW0630juD9A/UnNRSWRaZk+YdhEhfxc3GXRKavFJWgWEB6J8RbFUjD3Jmj2RB+NvhqckZh3Tmqe+6yQjTvNu71CkcsDq/LZO4=

Visual documentation

Captura de tela 2024-09-26 110128

Environment

- FlutterFlow version: v5.0.0+
- Platform: Web
- Browser name and version: Brave v1.70.119
- Operating system and version affected: Win11

Additional Information

No response

Alezanello commented 1 week ago

Hello!

I took a quick look at your project, and it seems that the apiUrl variable is not being set in your actions. You'll need to assign the apiUrl variable from your environment variables to the API call for it to work properly.

Let me know if you need further assistance!

image.png image.png
Rasochii commented 1 week ago

Hello!

I thought I wouldn't need to add it to the actions since it already has a default value, being the apiUrl of the Environment Values. In test mode and downloading an apk it works normally without needing to add a value.

Alezanello commented 3 days ago

Correct!
However, the default value may vary between environments, so it’s preferable to set it using environment variables. Have you tried doing that?

Rasochii commented 2 days ago

So, my two environments have the apiUrl filled in, so it wouldn't make much sense in run mode for it to be empty. But, I tried to use the way you suggested and it still doesn't appear haha

I'm going crazy about this already, man

I think it's not working because I'm not able to compile my custom codes (specifically, Actions and Widgets). I don't know if it has something to do with it, but at the moment, it's what makes me have a little hope that it will work.

I'm getting a bug every time I try to compile (Unknown error compiling custom code), but I'm seeing it with FF support