Closed kparkov closed 5 years ago
@kparkov r u importing the shim first thing?
i'm not sure if rn-nodeify
is compatible with expo
, because as far as I know, expo doesn't let you use native modules other than the ones it bundles. Node.js core module shims like for fs
(react-native-level-fs
), dgram
(react-native-udp
), net
(react-native-tcp
), crypto
(react-native-crypto
) all have native components. You might have to eject first, but check the docs
closing due to inactivity, will reopen if needed
Is it compatible yet? I've had problems with Node modules not being compatible with React Native for a week now, but ejecting Expo in order to use rn nodiefy is not an option. Is there any other work around?
Is it compatible yet? I've had problems with Node modules not being compatible with React Native for a week now, but ejecting Expo in order to use rn nodiefy is not an option. Is there any other work around?
I'm having the same issue, did you ever get it working?
Yeah, I did! You can check out my startup’s repo to see our package json. Check NEFTME’s profile to see :)
thowitz @.***> escreveu em sáb., 30/07/2022 às 20:45 :
Is it compatible yet? I've had problems with Node modules not being compatible with React Native for a week now, but ejecting Expo in order to use rn nodiefy is not an option. Is there any other work around?
I'm having the same issue, did you ever get it working?
— Reply to this email directly, view it on GitHub https://github.com/tradle/rn-nodeify/issues/77#issuecomment-1200283721, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALO7WVN22UEHY7PXCFCBZMDVWWA7NANCNFSM4GWPXXCQ . You are receiving this because you commented.Message ID: @.***>
@LuisNeves05 Thanks for the reply! I managed to fix my current error message (No identifiers allowed directly after numeric literal)
@thowitz Hello, same issue here, could you please share the way you fix it ?
@dlrandy If you comment out all your imports, does the error go away?
Yeah, I did! You can check out my startup’s repo to see our package json. Check NEFTME’s profile to see :) thowitz @.> escreveu em sáb., 30/07/2022 às 20:45 : … Is it compatible yet? I've had problems with Node modules not being compatible with React Native for a week now, but ejecting Expo in order to use rn nodiefy is not an option. Is there any other work around? I'm having the same issue, did you ever get it working? — Reply to this email directly, view it on GitHub <#77 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALO7WVN22UEHY7PXCFCBZMDVWWA7NANCNFSM4GWPXXCQ . You are receiving this because you commented.Message ID: @.>
Hey, What project is it than? can you send a link? I'm having the same issue, and no solution yet...
Thanks!
https://github.com/NEFTME/neftme-poc-dapp
Check it out @Frostswing
@LuisNeves05 Thanks!
was your trick using "stream-http" instead the rn-nodify npm? Or was is another thing? Since stream-http didn't do the trick for me :/
@Frostswing Have you tried the readable-stream package?
@thowitz Do you mean linking the stream to the readable-stream package? if so, it doesnt help...
This is my package.json:
"dependencies": {
"@react-native-community/masked-view": "^0.1.11",
"@react-navigation/bottom-tabs": "^6.4.0",
"@react-navigation/drawer": "^6.5.0",
"@react-navigation/native": "^6.0.13",
"airgram": "^5.0.0",
"assert": "^1.1.1",
"buffer": "^4.9.1",
"events": "^1.0.0",
"expo": "~46.0.9",
"expo-status-bar": "~1.4.0",
"firebase": "^9.12.1",
"i": "^0.3.7",
"i18next": "^21.9.2",
"npm": "^9.1.1",
"path-browserify": "^0.0.0",
"process": "^0.11.0",
"react": "18.0.0",
"react-i18next": "^11.18.6",
"react-native": "0.69.6",
"react-native-gesture-handler": "~2.5.0",
"react-native-level-fs": "^3.0.0",
"react-native-os": "^1.0.1",
"react-native-paper": "^4.12.4",
"react-native-reanimated": "~2.10.0",
"react-native-safe-area-context": "4.3.1",
"react-native-screens": "~3.15.0",
"react-native-vector-icons": "^9.2.0",
"react-navigation": "^4.4.4",
"readable-stream": "^1.0.33",
"rn-nodeify": "^10.3.0",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0"
},
"devDependencies": {
"@babel/core": "^7.12.9"
},
"private": true,
"react-native": {
"os": "react-native-os",
"path": "path-browserify",
"fs": "react-native-level-fs",
"_stream_transform": "readable-stream/transform",
"_stream_readable": "readable-stream/readable",
"_stream_writable": "readable-stream/writable",
"_stream_duplex": "readable-stream/duplex",
"_stream_passthrough": "readable-stream/passthrough",
"stream": "readable-stream"
},
"browser": {
"os": "react-native-os",
"path": "path-browserify",
"fs": "react-native-level-fs",
"_stream_transform": "readable-stream/transform",
"_stream_readable": "readable-stream/readable",
"_stream_writable": "readable-stream/writable",
"_stream_duplex": "readable-stream/duplex",
"_stream_passthrough": "readable-stream/passthrough",
"stream": "stream-browserify"// changing here to "readable-stream" doesnt help
@Frostswing Can you try replacing "stream": "stream-readable",
with "stream": "stream-browserify",
in your package.json?
stream-browserify
Same result :(
"dependencies": {
"@react-native-community/masked-view": "^0.1.11",
"@react-navigation/bottom-tabs": "^6.4.0",
"@react-navigation/drawer": "^6.5.0",
"@react-navigation/native": "^6.0.13",
"airgram": "^5.0.0",
"assert": "^1.1.1",
"buffer": "^4.9.1",
"events": "^1.0.0",
"expo": "~46.0.9",
"expo-status-bar": "~1.4.0",
"firebase": "^9.12.1",
"i": "^0.3.7",
"i18next": "^21.9.2",
"npm": "^9.1.1",
"path-browserify": "^0.0.0",
"process": "^0.11.0",
"react": "18.0.0",
"react-i18next": "^11.18.6",
"react-native": "0.69.6",
"react-native-gesture-handler": "~2.5.0",
"react-native-level-fs": "^3.0.0",
"react-native-os": "^1.0.1",
"react-native-paper": "^4.12.4",
"react-native-reanimated": "~2.10.0",
"react-native-safe-area-context": "4.3.1",
"react-native-screens": "~3.15.0",
"react-native-vector-icons": "^9.2.0",
"react-navigation": "^4.4.4",
"readable-stream": "^1.0.33",
"rn-nodeify": "^10.3.0",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0"
},
"devDependencies": {
"@babel/core": "^7.12.9"
},
"private": true,
"react-native": {
"os": "react-native-os",
"path": "path-browserify",
"fs": "react-native-level-fs",
"_stream_transform": "readable-stream/transform",
"_stream_readable": "readable-stream/readable",
"_stream_writable": "readable-stream/writable",
"_stream_duplex": "readable-stream/duplex",
"_stream_passthrough": "readable-stream/passthrough",
"stream": "stream-browserify"
},
"browser": {
"os": "react-native-os",
"path": "path-browserify",
"fs": "react-native-level-fs",
"_stream_transform": "readable-stream/transform",
"_stream_readable": "readable-stream/readable",
"_stream_writable": "readable-stream/writable",
"_stream_duplex": "readable-stream/duplex",
"_stream_passthrough": "readable-stream/passthrough",
"stream": "stream-browserify"
}
For the stream part i have found a solution to my exact issue here: https://github.com/nodejs/readable-stream/issues/313
Solves specifically the "evaluating 'process.version.slice'" error
But i'm still having issues using Expo and rn-nodify... But its for a different discussion
@Frostswing Nice one, glad to hear you fixed at least this problem👍Now onto the next one haha
My dependencies include
stream
and a handful of other core modules in an Expo project. I've tried a bunch of different strategies, and then someone recommendedrn-nodeify
.I have installed the
postinstall
script:Yet, after a clean and run
npm install
(I can confirm it installs the shims), I get this error when I run it withnpm start
:Am I doing something wrong here? Should Expo (and
stream
) be supported?