tradle / rn-nodeify

hack to allow react-native projects to use node core modules, and npm modules that use them
MIT License
619 stars 112 forks source link

rn-nodeify is breaking VSCode's debug feature #63

Open edgebal opened 6 years ago

edgebal commented 6 years ago

Hello,

Apparently rn-nodeify is breaking the bridge between Visual Studio Code's React Native extension and the bundler.

The debugger worker tries to call process.send, but the following error is thrown:

Starting debugger app worker.
Established a connection with the Proxy (Packager) to the React Native application
Debugger worker loaded runtime on port 34436
TypeError: process.send is not a function
debuggerWorker.js:40
    at postMessage ([PROJECT_WORKSPACE_ROOT]/.vscode/.react/debuggerWorker.js:40:13)
    at sendReply ([PROJECT_WORKSPACE_ROOT]/.vscode/.react/debuggerWorker.js:113:7)
    at executeApplicationScript ([PROJECT_WORKSPACE_ROOT]/.vscode/.react/debuggerWorker.js:98:7)
    at [PROJECT_WORKSPACE_ROOT]/.vscode/.react/debuggerWorker.js:119:7
    at process.<anonymous> ([PROJECT_WORKSPACE_ROOT]/.vscode/.react/debuggerWorker.js:35:9)
    at emitTwo (events.js:126:13)
    at process.emit (events.js:214:7)
    at emit (internal/child_process.js:772:12)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

More information and related issue on VSCode's repo: https://github.com/Microsoft/vscode-react-native/issues/606

mvayngrib commented 6 years ago

@edgebal thanks for reporting this! Unfortunately, I don't have any experience with VSCode. I can tell that in rn-nodeify/shim.js, global.process is assigned (if it's not already defined). If you figure out what the issue is, PRs are very welcome :)

guiac commented 6 years ago

@edgebal I had the same problem when I installed the react-native-tcp and rn-nodeify package. Do you solved this problem?