Skip to content

fix(audio-context): build on iOS without @nativescript/canvas - #181

Merged
triniwiz merged 1 commit into
masterfrom
fix/audio-context-standalone-ios
Oct 9, 2026
Merged

triniwiz merged 1 commit into
masterfrom
fix/audio-context-standalone-ios

Conversation

@triniwiz

@triniwiz triniwiz commented Oct 9, 2026

Copy link
Copy Markdown
Member

An app that installs @nativescript/audio-context without @nativescript/canvas fails to build on iOS:

NativeScript.framework/Headers/runtime/Common.h:6:10: fatal error: 'v8.h' file not found

AudioModule.mm includes the runtime's Runtime.h, and the runtime headers include V8 by bare name (#include "v8.h"). That only resolves when the V8 Headers/include dir is on the search path. Until now, only canvas's build.xcconfig added it, so the build worked only when canvas was installed too.

audio-context already ships the NativeScriptV8 SwiftPM shim. This PR adds the xcconfig half of the canvas-svg fix (87479e1):

  • Add the shim's Headers/include as -I flags. Like canvas, it uses two roots: the installed npm package and this monorepo. The variables are prefixed AUDIO_CONTEXT_ so they don't collide with canvas's or svg's.
  • Build as C++20, which V8 14.9's headers require.

Verification

Syntax-checked AudioModule.mm with clang against the iOS simulator SDK, using only the runtime framework and the shim's Headers root (what a standalone app gets):

Flags Result
none (before) fatal error: 'v8.h' file not found
include root, C++17 error: "C++20 or later required."
include root + C++20 (this PR) clean

Not yet tested with a full ns build of a standalone app.

AudioModule.mm includes the runtime's Runtime.h, whose headers include V8
by bare name ("v8.h"), so an app with only audio-context failed to build
('v8.h' file not found). It only worked when @nativescript/canvas was
installed too, since canvas's build.xcconfig puts Headers/include on the
search path.

audio-context already ships the NativeScriptV8 SwiftPM shim; as in #180 for
canvas-svg, add the shim's Headers/include to the search path and build as
C++20 for V8 14.9.
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ce5f4acc-ec0c-4f09-a8e0-8af806811565

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@triniwiz
triniwiz merged commit c5555e3 into master Oct 9, 2026
14 of 21 checks passed
@triniwiz
triniwiz deleted the fix/audio-context-standalone-ios branch October 9, 2026 18:52
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