'Failed to load asset at "assets/dotenv.develop" in flutter web
I am using .env file in flutter web.
Everything is OK when I run my project, locally on chrome and build apk.
But when I run my project in azure pipeline to deploy my flutter web, I get these errors:
GET https://***.net/assets/fonts/MaterialIcons-Regular.otf 404 (Not Found)
GET https://***.net/assets/.env.develop 404 (Not Found)
I tried running my project without .env file and everything was OK.
To solve this issue, I have been trying to removed the dot from the start of file name from ".env" to "dotenv".
Also I added the file into the assets directory and include the file in the pubspec.yaml.
But didn't solve my issue.
Solution 1:[1]
Don't use .env as name for config file, use a name without "." Eg: dotenv
Here is the issue https://github.com/java-james/flutter_dotenv/issues/28
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Hasan Masum |
