Skip to content

Fix Windows path separator bug in registerNativeComponents()#163

Open
rdanklof wants to merge 1 commit into
NativePHP:mainfrom
rdanklof:fix/windows-path-separator
Open

Fix Windows path separator bug in registerNativeComponents()#163
rdanklof wants to merge 1 commit into
NativePHP:mainfrom
rdanklof:fix/windows-path-separator

Conversation

@rdanklof

Copy link
Copy Markdown

Summary

Some developers are required to work on Windows due to company policy. When testing via the Jump app on Windows, native components (e.g. `native:bottom-nav`) failed to register because `SplFileInfo::getPathname()` returns backslashes, while the base path was stripped using a hardcoded `/` separator.

Fixed by normalizing both paths with `str_replace('\\', '/')` and using `substr` + `strlen` to extract the relative path.

Test plan

  • On Windows: open the Jump app and verify native components render correctly
  • Verify no regression on macOS/Linux

On Windows, SplFileInfo::getPathname() returns backslashes, causing
str_replace() with a forward-slash base path to never match. Normalize
both paths to forward slashes before comparing so component registration
works on all platforms.
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.

1 participant