New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't resolve fs module when using with server-side rendering and defaults #136
Comments
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/136 |
Yeah that should not be happening especially since the package is installed as a devDependency, but you said you followed the troubleshooting guide. Also the whitespace seems to be a caching issue. I'm going to be updating the readme next week with a recommended package to help with the caching issue. It's coming up in every other ticket 😓 https://www.npmjs.com/package/react-native-clean-project |
This is in dev mode, which I should have emphasized more. Perhaps one solution would be to somehow mix solutions, but thought it was interesting how the moduleName made a difference. |
Oh I know now what happened!! If you change
|
@goatandsheep yep, did that. I was able to find and replace |
Well, thanks so much for the submission! I'm going to leave this open because this is valid. I might just recommend people set their moduleName to If you have suggestions, feel free to comment below or open a PR. |
Good idea. |
Describe the bug
Next gives me the error that it can't resolve the modules
fs
when I use amoduleName
other thanreact-native-dotenv
. I tried fixing another bug by using the defaults (@env
), but that seemed to produced this problem. This may be unique tonext@9
or whatever webpack it uses.For the curious, I seem to have eliminated my original bug but updating things blindly, but it was a case of
react-native-dotenv
returningundefined
for variables, depending on whether I did a console log in a particular place. That "solution" seemed to be machine-specific, as another user resolved still faced it but resolved it by removing some whitespace.To Reproduce
Steps to reproduce the behavior:
next@9
,@expo/next-adapter
and the latestreact-native-dotenv
with default settings.next
.Expected behavior
The server-side rendering shouldn't fail with an error about
dotenv
not being able to resolvefs
.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: