Repository navigation
fix: lazy-load @ngrok/ngrok so the CLI works under Windows Smart App Control - #174
Merged
Merged
Conversation
…Control tunnel-service imported @ngrok/ngrok at the top level, and apps-service imported getTunnelingDomain from it. Through utils/region and dynamic-choices-service, ~27 commands (code:push, app:deploy, code:logs, app:list, scheduler:*, storage:*, ...) loaded the unsigned ngrok native addon at startup. Windows Smart App Control blocks that addon, so those commands failed with ERR_DLOPEN_FAILED. - Load @ngrok/ngrok with a dynamic import inside createTunnelConnection, so only tunnel:create needs it - Report a clear error when the OS blocks the addon (suggest WSL2/Docker), or a generic load error otherwise; both keep the original error as cause - Make the type import in types/commands/tunnel type-only - Add a lint rule rejecting value imports of @ngrok/ngrok - Bump version to 4.11.2 DoW: https://monday.monday.com/boards/8441268359/pulses/13503936493 Task: https://monday.monday.com/boards/18426314812/pulses/13570920106 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lukaszda-monday
approved these changes
Nov 18, 2026
daniilvo
approved these changes
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Windows 11 with Smart App Control on,
mapps code:push,mapps app:deployand most other commands fail at startup:services/tunnel-service.tsimported@ngrok/ngrokat the top level, andapps-serviceimportsgetTunnelingDomain(a plain HTTP call) from it. Throughutils/regionanddynamic-choices-service, about 27 commands loaded the unsigned ngrok native addon, not onlytunnel:create. No signed ngrok build exists, so upgrading doesn't help.Fix
@ngrok/ngrokis now loaded with a dynamicimport()insidecreateTunnelConnection, so onlytunnel:createneeds it.ERR_DLOPEN_FAILED/ "Application Control policy"),tunnel:createexplains this and suggests WSL2/Docker. Any other load failure gives "Failed to load the ngrok module required for tunneling." Both keep the original error message andcause, and the load happens outside thetry, so the generic "Failed to create tunnel connection." can't replace it.types/commands/tunnel.tsnow usesimport type.@typescript-eslint/no-restricted-importsrule rejects value imports of@ngrok/ngrok(type imports are allowed).tunnel:createitself still can't run under Smart App Control, because the binary is unsigned. The new error message points to the WSL2/Docker workaround.Testing
tunnel-service.test.ts: happy path, blocked by OS policy, and generic load failure. The failure tests fail if the load error gets replaced by the generic error.yarn lint(0 errors),yarn test,yarn build. The compileddist/services/tunnel-service.jsonly has the dynamicimport('@ngrok/ngrok')..nodefiles replaced by junk to reproduceERR_DLOPEN_FAILED:mapps app:listworks.mapps tunnel:createshows the new error with the original dlopen error underneath.mapps tunnel:createconnects normally.Links
🤖 Generated with Claude Code