Windows addon loaders are unreachable and swallow load errors
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 54/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- cpp
- Domain
- operating-systems
Research direction
Start in packages/host/cpp/CxxNodeApiHostModule.hpp and AddonLoaders.hpp, then inspect the loader caller in CxxNodeApiHostModule.cpp and logging APIs in Logger.hpp. Confirm the platform-specific loader alias and trace the four Windows failure paths. Done means Windows selects the appropriate loader and reports captured load or symbol errors instead of swallowing them.
Written by the indexing model from the issue text.
Description
Grouping the FIXME/HACK in CxxNodeApiHostModule.hpp with the four TODOs in AddonLoaders.hpp. Both halves of the Windows story are incomplete, and the first makes the second unobservable.
The loader policy is hardcoded to POSIX
Win32Loader and WinRTLoader exist in AddonLoaders.hpp and are compiled behind #if defined(_WIN32), but nothing ever selects them — LoaderPolicy is unconditionally PosixLoader. The alias should be chosen by platform (_WIN32 → Win32Loader, with WinRT distinguished by the appropriate API-family macro, POSIX otherwise), which is a compile-time #if rather than a design question.
The Windows loaders discard the reason for every failure
All four failure paths detect the error and then do nothing with it:
LoadLibrary/LoadPackagedLibrary/GetProcAddress all return null and leave the reason in GetLastError(). Returning null without capturing it means the caller in CxxNodeApiHostModule.cpp can only report "Failed to load library" — the distinction between "file not found", "a transitive dependency is missing" and "wrong architecture" is lost, and those are precisely the three things a developer needs to tell apart. PosixLoader has the same shape of gap but at least has dlerror() available; the commented-out NSLog there suggests it was once wired up.
Suggested minimum: format the DWORD via FormatMessageA and route it through log_error/log_debug from Logger.hpp, matching how the POSIX path should report dlerror().
Both were listed in the original permalinks on #30. Relevant to #305 (Windows test app on CI) — without a Windows test app these paths stay unexercised whichever way they are fixed.
- Dominant language
- TypeScript
- Stars
- 206
- Forks
- 12
- Avg merge
- 4h 8m
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstackincubator/react-native-node-api
-
Android 🤖
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
Sanity check of Hermes source directory via environment variable, when building Android projectsOpenAndroid 🤖 good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
callstackincubator/react-native-node-api#163 · 1 comment ·
-
enhancement good first issue gyp-to-cmake
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
callstackincubator/react-native-node-api#161 · 3 comments · 1 reaction ·
-
enhancement Linking 🔗
Difficulty 5/5 Over a week Newbie friendliness 8/100
-
enhancement Linking 🔗
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in callstackincubator/react-native-node-api
Similar issues
-
prio:low scope:hud
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OliverRomhagen/vrigstad-joyride#953 ·
Maintainers usually reply within 1 day
-
review-followup
Difficulty 1/5 Under an hour Newbie friendliness 92/100
griffinwork40/agent-afk#5446 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
kacper-szewczyk/Ticknest#346 ·
Maintainers usually reply within 1 day
-
echarts geo: a GeoJSON URL that returns 200 with a body that is not JSON is fetched on each refreshOpenbug plugin/echarts/geo
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Yeachan-Heo/gajae-code#8230 ·
Maintainers usually reply within 1 day