goatandsheep / react-native-dotenv

Load react native environment variables using import statements for multiple env files.
https://www.npmjs.com/package/react-native-dotenv
MIT License
787 stars 46 forks source link

Error after edit process.env in code #502

Open ObscurusGrassator opened 1 month ago

ObscurusGrassator commented 1 month ago

code in index.jsx:

process.env.ABC = 123;

error:

Property left of AssignmentExpression expected node to be of a type ["LVal","OptionalMemberExpression"] but instead got "StringLiteral"
warning: the transform cache was reset.
debug Checking for a newer version of React Native
debug Current version: 0.74.1
debug Cached release version: 0.74.1
debug Checking for newer releases on GitHub
                Welcome to Metro v0.80.9
              Fast - Scalable - Integrated

adebug Latest release: 0.74.1 (undefined)

...

> Task :app:installDebug
Installing APK 'app-debug.apk' on 'Pixel_7_Pro_API_34(AVD) - 14' for :app:debug
Installed on 1 device.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 7s
242 actionable tasks: 31 executed, 211 up-to-date
info Connecting to the development server...
info Starting the app on "emulator-5554"...
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.jjassistant/.MainActivity }
 BUNDLE  ./index.js 

error: App/index.jsx: .../App/index.jsx: Property left of AssignmentExpression expected node to be of a type ["LVal","OptionalMemberExpression"] but instead got "StringLiteral"

Desktop (please complete the following information):

Smartphone (please complete the following information):

github-actions[bot] commented 1 month ago

Hey, thank you for opening this issue! 🙂 To boost priority on this issue and support open source please tip the team at https://issuehunt.io/r/goatandsheep/react-native-dotenv/issues/502

metacop commented 1 week ago

not working react-native 0.74.1 Install react-native-dotenv, and I have react-native 0.74.1, follow all the steps, restart the computer. I applied cache reset and nothing. any solution? image

any solution?

metacop commented 1 week ago

not working react-native 0.74.1 Install react-native-dotenv, and I have react-native 0.74.1, follow all the steps, restart the computer. I applied cache reset and nothing. any solution? image

any solution?

image