Skip to content

fix(nanoflow-actions-native): GetStraightLineDistance runtime errors - 11.6 - #689

Merged
NikolaSimsic merged 2 commits into
mx/11.6.xfrom
moo/fix-get-straight-line-distance-mx/11.6.x
Oct 22, 2026
Merged

NikolaSimsic merged 2 commits into
mx/11.6.xfrom
moo/fix-get-straight-line-distance-mx/11.6.x

Conversation

@stelselim

Copy link
Copy Markdown
Contributor

Checklist

  • Contains unit tests ❌
  • Contains breaking changes ❌
  • Did you update version and changelog? Changelog ✅ (Unreleased), version ❌ (left to the release process)
  • Works in Android / iOS / Web: Not tested manually on this branch; the same change was tested on web on mx/11.12.x.

This PR contains

  • Bug fix

What is the purpose of this PR?

Support ticket: in the latest Nanoflow Commons, the GetStraightLineDistance action fails at runtime. There are two errors, in this order:

  1. deg2rad is not defined
  2. After fixing that: Big is not defined

Relevant changes

  • GetStraightLineDistance.ts: the first statement after // BEGIN EXTRA CODE was a type alias. TypeScript drops type aliases together with their leading comment, so the built file had no // BEGIN EXTRA CODE marker. Studio Pro then discarded the helper functions (deg2rad, kmToStatueMile, kmToNauticalMile). The alias is moved after the helpers so the marker survives.
  • configs/jsactions/rollup-plugin-bigjs-import-replacer.mjs: the plugin removed import { Big } from "big.js"; from all built JS actions, expecting mxbuild to add it back. It does not, so every action that creates Big values failed. The plugin now keeps the import (normalized to double quotes). This affects both Nanoflow Commons and Native Mobile Resources (for example TimeBetween, GetCurrentLocation, ShowProgress, SignIn, GetDeviceInfo).
  • Changelog entries for both modules.

What should be covered while testing?

  • Run GetStraightLineDistance from a nanoflow (web and native) and check the result.
  • Run another action that returns or creates decimals (for example TimeBetween, GetCurrentLocation) on web and native.
  • Check whether Studio Pro shows changes in javascriptsource/ after a fresh module import. The Big import now appears above the generated header, like other imports already do.

Extra comments (optional)

Cherry-pick of the mx/11.12.x fix. Verified the same way as the other PRs. Note: on this branch the jsactions build fails before this change too (`resolve` has no default export in `rollup-plugin-collect-dependencies.mjs` with the installed `resolve@2.0.0-next.7`). I patched that import locally only to verify; it is not part of this PR.

🤖 Generated with Claude Code

stelselim and others added 2 commits October 20, 2026 14:34
The bigjs import replacer stripped `import { Big } from "big.js"` from the
build output, assuming mxbuild would re-add it. It does not, so actions
creating Big values failed at runtime with "Big is not defined".

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@stelselim
stelselim requested a review from a team as a code owner October 20, 2026 12:36
@NikolaSimsic
NikolaSimsic merged commit 54341da into mx/11.6.x Oct 22, 2026
19 of 22 checks passed
@NikolaSimsic
NikolaSimsic deleted the moo/fix-get-straight-line-distance-mx/11.6.x branch October 22, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants