Skip to content

Conversation

@Overtorment
Copy link
Member

  • ditched rn-nodeify in favor of simple metro bundler configuration
  • had to switch from react-native-crypto to crypto-browserify, same thing except it now doesnt try to install react-native-randombytes
  • managed to remove some deps that seems are not necessary anymore: path-browserify, process (shimmed own minmal implementation)

tests pass, but have to stay vigilant in case something is broken

@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​crypto-browserify@​3.12.1991009184100

View full report

process[p] = bProcess[p];
}
}
global.process = {};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Process Shim Initialization Overwrites Environment

The process shim's updated initialization creates an empty global.process object without process.env, and no longer merges properties from the process npm package into an existing process object. This leads to a TypeError when process.env.NODE_ENV is later set, and other process properties previously provided by the shim may also be missing.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shim is only included in RN runtime, where there are no env vars anyway

tls: require.resolve('react-native-tcp-socket'),
},
},
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Missing Polyfill for path Module Causes Runtime Errors

The Metro configuration is missing a polyfill for the path module in extraNodeModules. While path-browserify previously handled this, it was removed from dependencies without adding an equivalent mapping. This will cause runtime errors if any code or dependency tries to use the path module.

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently path module is not used?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently path module is not used?

I checked the code and didn’t see any occurrences of the path being used. I also built and ran the app successfully, so removing path-browserify should be safe.

Copy link
Member

@ojokne ojokne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Non-blocking: path-browserify is still referenced in the following via their "react-native" / "browser" mappings.

These mappings may no longer be necessary, as the path module doesn’t appear to be used. Just noting this for awareness.

@GladosBlueWallet
Copy link
Collaborator

@Overtorment Overtorment merged commit 26d4f40 into master Sep 19, 2025
14 checks passed
@Overtorment Overtorment deleted the refactor-ditch-rn-nodeify branch September 19, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants