FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

How to user Flutter_dotenv on Web · Issue #75 · java-james/flutter_dotenv · GitHub

Repository navigation

How to user Flutter_dotenv on Web #75

Description

Do I need some additional step for using this package on web?

I'm running it on Android/IOS and all goes fine.

But when I try to run the project on Web I get the follwing errors:

3  Locations: No module for http://localhost:58501/dart_sdk.js 

Locations: No module for http://localhost:58501/dart_sdk.js 

Locations: No module for http://localhost:58501/dart_sdk.js 

Locations: No module for http://localhost:58501/dart_sdk.js 

109  Locations: No module for http://localhost:58501/dart_sdk.js 

Locations: No module for http://localhost:58501/

The code for loading the dotenv files is:
await dotenv.load( fileName: 'assets/${kReleaseMode ? 'prod.env' : 'dev.env'}', );

My env files are under the assets folder

The files are also added to pubspec.yaml as:

Activity

  1. jstdk commented on Nov 4, 2022

    Same question here. Can't get it to work on Vercel & Netlify

  2. robert-virkus commented on Nov 24, 2022

    In may case I had to move the .env file into the root of my project, then it worked fine.
    So in pubspec.yaml I have:

      assets:
        - .env
  3. arefrafei92 commented on Jul 6, 2024

    If somebody else reached out here, here is your answer : ##95 (comment)

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


      Back | FazBrowse Home | New Git URL