Skip to content

[WEB] When using the Firebase hosting. Failed to read variables from .env file. #66

Open

Description

@iCodePoet

Issue

When using the Firebase hosting. Failed to read variables from .env file.

I thought it was solved in #28 (comment) issue by @java-james , but there is still a problem.

image


When I change the file name to dotenv referring to the same issue(#28), a different error is printed.

My Code:

void main() async {
  await dotenv.load(fileName: "dotenv");
  ...


  runApp(const MyApp());
}

image

Activity

  1. changed the title [-]When using the Firebase hosting. Failed to read variables from .env file.[/-] [+][WEB] When using the Firebase hosting. Failed to read variables from .env file.[/+] on Aug 11, 2022
  2. iCodePoet commented on Aug 11, 2022

    @iCodePoet
    Author

    The cause of the error was found when setting the environment variable with the dotenv file.

    image

    This error occurs when �I create it in this way.

    SOME_ENV=abcdefg
    

    But if I write it like this, it works normally.

    SOME_ENV='abcdefg'
    
  3. martinpelli commented on May 19, 2023

    @martinpelli

    I am having this error when using this plugin, took me 4 hours to know it was this plugin as the error has a bad description.
    image
    I have my variables like
    SOME_ENV=abcdefg
    and changing them to
    SOME_ENV='abcdefg'
    doesn't work, the only solution that I have right now is to not use the plugin on web.

  4. zahidshaikh9013 commented on Sep 10, 2024

    @zahidshaikh9013

    Still no updates ????

  5. zahidshaikh9013 commented on Sep 10, 2024

    @zahidshaikh9013

    The cause of the error was found when setting the environment variable with the dotenv file.

    image

    This error occurs when �I create it in this way.

    SOME_ENV=abcdefg
    

    But if I write it like this, it works normally.

    SOME_ENV='abcdefg'
    

    This also does not help for me

  6. Eng-Mohamed-Elsayed commented on Dec 15, 2024

    @Eng-Mohamed-Elsayed

    The same problem when Flutter web runs debug works fine but when uploading Firebase hosting or any server-side, it does not work env
    any solution?

  7. htoopyaelinn56 commented on Jan 15, 2025

    @htoopyaelinn56

    same problem here when deploying to firebase

  8. htoopyaelinn56 commented on Jan 15, 2025

    @htoopyaelinn56

    #28 This helps. Removing . from env, from .env to env

  9. zahidshaikh9013 commented on Jan 15, 2025

    @zahidshaikh9013

    htoopyaelinn56

    No it's not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions