Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .cspell-wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -450,3 +450,7 @@ eurollm
doclayout
netp
Uyghur
cocoapods
ARCHS
Podfile
armeabi
9 changes: 5 additions & 4 deletions docs/docs/01-fundamentals/01-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ yarn add react-native-executorch react-native-worklets react-native-blob-util
<TabItem value="pnpm" label="pnpm">

```bash
pnpm add react-native-executorch react-native-worklets react-native-blob-util
pnpm add react-native-executorch react-native-worklets react-native-blob-util --allow-build=react-native-executorch
```

</TabItem>
Expand Down Expand Up @@ -131,12 +131,13 @@ worklets 0.10 accepts.

### Babel

The library runs inference on worklet threads, so add the worklets Babel plugin
to `babel.config.js`. It must be the **last** entry in `plugins`:
The library runs inference on worklet threads. Expo's `babel-preset-expo` adds
the worklets plugin by itself, so an Expo app needs no `babel.config.js` for it.
In a bare app, add the plugin as the **last** entry in `plugins`:

```js
module.exports = {
presets: ['module:@react-native/babel-preset'], // or 'babel-preset-expo'
presets: ['module:@react-native/babel-preset'],
plugins: [
// ...your other plugins
'react-native-worklets/plugin',
Expand Down
9 changes: 5 additions & 4 deletions docs/docs/03-core-and-advanced/08-native-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ The block is read from the directory the install was run in, then from every
actually resolved, and the install log names the manifest it read.
:::

:::caution pnpm and npm 12
pnpm 10 and later, and npm 12 and later, do not run dependency install scripts
:::caution pnpm, bun and npm 12
pnpm 10 and later, bun, and npm 12 and later do not run dependency install scripts
unless you allow them, so the download never happens and the native build fails
later on a missing file. Run `pnpm approve-builds react-native-executorch` or
`npm approve-scripts react-native-executorch` once. See
later on a missing file. Install with `--allow-build=react-native-executorch`
(pnpm), run `bun pm trust react-native-executorch` (bun) or
`npm approve-scripts react-native-executorch` (npm 12) once. See
[Troubleshooting](../05-other/02-troubleshooting.md).
:::

Expand Down
39 changes: 32 additions & 7 deletions docs/docs/05-other/02-troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ The native artifacts are not in the npm tarball. They are downloaded by a
**postinstall** hook, and your package manager skipped it:

- **pnpm 10 and later block dependency build scripts by default** and print

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--allow-build was introduced in pnpm 10.4.0, so the new installation command doesn’t cover all versions described as “pnpm 10 and later.” Specify pnpm ≥10.4 or provide configuration plus rebuild instructions for earlier versions. pnpm documentation

`Ignored build scripts: react-native-executorch` during install.
`Ignored build scripts: react-native-executorch` during install. Installing
with `--allow-build=react-native-executorch` avoids it.
- **bun** does the same for any package not in `trustedDependencies`.
- **npm 12 and later** (and npm 11.16+ with `strict-allow-scripts=true`) skip
install scripts of packages not listed in `allowScripts`, with only a warning.
- `--ignore-scripts`, and `npm ci --ignore-scripts`, do the same.
Expand All @@ -32,7 +34,8 @@ for the file. Recent versions fail during `pod install` (and during the Android
configure phase) with this fix in the message instead. Re-run the hook:

```bash
pnpm approve-builds react-native-executorch # pnpm
pnpm approve-builds # pnpm, select it
bun pm trust react-native-executorch # bun
npm approve-scripts react-native-executorch # npm 12+, then:
npm rebuild react-native-executorch # npm
node node_modules/react-native-executorch/scripts/download-libs.js
Expand Down Expand Up @@ -72,9 +75,9 @@ turns that off again.
statically linked binaries: (.../opencv-rne/opencv2.xcframework)
```

`use_frameworks!` with no argument means **dynamic** linkage, which CocoaPods
refuses to combine with a statically linked dependency. Ask for static
frameworks instead:
Versions before 0.11 could not be built with **dynamic** frameworks, which
`use_frameworks!` with no argument means and which `@react-native-firebase` 27+
requires. Update the library; on an older version, ask for static frameworks:

```ruby
use_frameworks! :linkage => :static
Expand Down Expand Up @@ -136,13 +139,35 @@ image. Use an Apple silicon machine, or a physical device.
```

This is a **warning**, so `pod install` still succeeds and the failure surfaces
later. The library needs iOS 17. In an Expo app, set it explicitly — the default
is lower:
later. On the bare template, whose default is iOS 15.1, `pod install` fails
instead: `required a higher minimum deployment target`. The library needs iOS
17: set `platform :ios, '17.0'` in the `Podfile`, or in an Expo app:

```json
["expo-build-properties", { "ios": { "deploymentTarget": "17.0" } }]
```

## `deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0`

```
error: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set
to 11.0, but the range of supported deployment target versions is 15.0 to 27.2.x.
(in target 'react-native-blob-util-ReactNativeBlobUtilPrivacyInfo')
```

`react-native-blob-util` 0.25 declares iOS 11, which Xcode 27 rejects. Expo SDK
56 and later fix this up for you; elsewhere raise its targets in the `Podfile`:

```ruby
post_install do |installer|
installer.pods_project.targets.each do |t|
t.build_configurations.each do |c|
c.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.1' if c.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 15.0
end
end
end
```

## The `react-native-executorch` config block is ignored

The postinstall hook reads the block from the directory where the install was
Expand Down
11 changes: 6 additions & 5 deletions packages/react-native-executorch/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ fun requireNativeArtifacts() {
${libsDir.absolutePath}

They are downloaded by this package's postinstall hook, which your
package manager did not run. pnpm 10 and later block dependency build
scripts by default ("Ignored build scripts"), npm 12 skips install
scripts not listed in `allowScripts`, and `--ignore-scripts` does the
same. Re-run the hook:
package manager did not run. pnpm 10 and later, and bun, block
dependency build scripts by default ("Ignored build scripts"), npm 12
skips install scripts not listed in `allowScripts`, and
`--ignore-scripts` does the same. Re-run the hook:

pnpm approve-builds react-native-executorch # pnpm
pnpm approve-builds # pnpm, select it
bun pm trust react-native-executorch # bun
npm approve-scripts react-native-executorch # npm 12+, then:
npm rebuild react-native-executorch # npm
node node_modules/react-native-executorch/scripts/download-libs.js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ unless missing.empty?
#{missing.map { |path| " #{path}" }.join("\n")}

They are downloaded by this package's postinstall hook, which your package
manager did not run. pnpm 10 and later block dependency build scripts by
default ("Ignored build scripts"), npm 12 skips install scripts not listed
in `allowScripts`, and `--ignore-scripts` does the same. Re-run the hook,
manager did not run. pnpm 10 and later, and bun, block dependency build
scripts by default ("Ignored build scripts"), npm 12 skips install scripts
not listed in `allowScripts`, and `--ignore-scripts` does the same. Re-run the hook,
then `pod install` again:

pnpm approve-builds react-native-executorch # pnpm
pnpm approve-builds # pnpm, select it
bun pm trust react-native-executorch # bun
npm approve-scripts react-native-executorch # npm 12+, then:
npm rebuild react-native-executorch # npm
node node_modules/react-native-executorch/scripts/download-libs.js
Expand Down
Loading