Commit e63cc8c
fix(example): strip file:// prefix from DocumentPicker URI
Stage B device measurement surfaced a bug in the native module:
ExpoLitertLmModule.swift:96 calls `URL(fileURLWithPath: modelPath)`,
which interprets its arg as a literal POSIX path. When
DocumentPicker.getDocumentAsync({copyToCacheDirectory: false})
returns a file:// URI string, the constructed URL has a malformed
`.path` that FileManager.fileExists(atPath:) returns false for —
surfacing in JS as "LiteRT-LM model file not found".
This commit applies the workaround in the example so device
measurement can complete: strip `file://` from the picker URI before
setModelPath. Metro hot-reloads; no rebuild needed.
The proper fix in the native module — accept either a POSIX path or
a file:// URL — lands in 0.2.0-rc.0.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8cb580b commit e63cc8c
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
86 | 91 | | |
87 | 92 | | |
88 | 93 | | |
| |||
0 commit comments