You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm developing an app with react-native-web and I can't get react-native-dotenv to work in web mode.
My react-native-web setup works with react-scripts.
I do not use expo.
I didn't override the webpack config.
Is the lib compatible with react-native-web?
Is it necessary to modify the configuration of webpack?
Here are the errors I got:
ERROR in ./node_modules/dotenv/lib/main.js 24:11-24
Module not found: Error: Can't resolve 'fs' in '/Users/***/node_modules/dotenv/lib'
ERROR in ./node_modules/dotenv/lib/main.js 26:13-28
Module not found: Error: Can't resolve 'path' in '/Users/***/node_modules/dotenv/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/dotenv/lib/main.js 28:11-24
Module not found: Error: Can't resolve 'os' in '/Users/***/node_modules/dotenv/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
- install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "os": false }
ERROR in ./node_modules/react-native-dotenv/index.js 3:4-17
Module not found: Error: Can't resolve 'fs' in '/Users/***/node_modules/react-native-dotenv'
The text was updated successfully, but these errors were encountered:
Are you importing this as a prod dependency? For projects, use devDependency. Only if you're building a babel lib (for whatever purpose) do you need this as a prod dependency. i should add this to the readme
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I'm developing an app with react-native-web and I can't get react-native-dotenv to work in web mode.
My react-native-web setup works with react-scripts.
I do not use expo.
I didn't override the webpack config.
Is the lib compatible with react-native-web?
Is it necessary to modify the configuration of webpack?
Here are the errors I got:
The text was updated successfully, but these errors were encountered: