Skip to content

Commit 9357bbc

Browse files
authored
Apply feedback (#265)
1 parent 9cdb703 commit 9357bbc

File tree

4 files changed

+46
-5
lines changed

4 files changed

+46
-5
lines changed

client-sdk-references/javascript-web.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ This SDK supports multiple Virtual File Systems (VFS), responsible for storing t
329329

330330
- This system utilizes IndexedDB as its underlying storage mechanism.
331331
- Multiple tabs are fully supported across most modern browsers.
332-
- Users may experience stability issues when using Safari.
332+
- Users may experience stability issues when using Safari. For example, the `RangeError: Maximum call stack size exceeded` error. See [Troubleshooting](/resources/troubleshooting#rangeerror-maximum-call-stack-size-exceeded-on-ios-or-safari) for more details.
333333

334334
#### 2. OPFS-based Alternatives
335335

client-sdk-references/javascript-web/usage-examples.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import JavaScriptCallbackWatch from '/snippets/basic-watch-query-javascript-call
1111
<Warning>
1212
* Multiple tab support is not currently available on Android.
1313
* For Safari, use the [`OPFSCoopSyncVFS`](/client-sdk-references/javascript-web#sqlite-virtual-file-systems) virtual file system to ensure stable multi-tab functionality.
14+
* If you encounter a `RangeError: Maximum call stack size exceeded` error, see [Troubleshooting](/resources/troubleshooting#rangeerror-maximum-call-stack-size-exceeded-on-ios-or-safari) for solutions.
1415
</Warning>
1516

1617
Using PowerSync between multiple tabs is supported on some web browsers. Multiple tab support relies on shared web workers for database and sync streaming operations. When enabled, shared web workers named `shared-DB-worker-[dbFileName]` and `shared-sync-[dbFileName]` will be created.

resources/troubleshooting.mdx

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,53 @@ sidebarTitle: "Overview"
66

77
## Common issues
88

9+
<Tip>
10+
**Tip**: Asking the AI bot on this page, or on the [#gpt-help](https://discord.com/channels/1138230179878154300/1304118313093173329) channel on our [Discord server](https://discord.com/invite/powersync), is a good way to troubleshoot common issues.
11+
</Tip>
12+
913
### `SqliteException: Could not load extension` or similar
1014

1115
This client-side error or similar typically occurs when PowerSync is used in conjunction with either another SQLite library or the standard system SQLite library. PowerSync is generally not compatible with multiple SQLite sources. If another SQLite library exists in your project dependencies, remove it if it is not required. In some cases, there might be other workarounds. For example, in Flutter projects, we've seen this issue with `sqflite 2.2.6`, but `sqflite 2.3.3+1` does not throw the same exception.
1216

13-
<Note>
14-
Tip: Asking the AI bot on the [#gpt-help](https://discord.com/channels/1138230179878154300/1304118313093173329) channel on our [Discord server](https://discord.com/invite/powersync) is a good way to troubleshoot common issues.
15-
</Note>
17+
### `RangeError: Maximum call stack size exceeded` on iOS or Safari
18+
19+
This client-side error commonly occurs when using the PowerSync Web SDK on Safari or iOS (including iOS simulator).
20+
21+
**Solutions:**
22+
23+
1. **Use OPFSCoopSyncVFS (Recommended)**: Switch to the `OPFSCoopSyncVFS` virtual file system, which provides better Safari compatibility and multi-tab support:
24+
25+
```js
26+
import { PowerSyncDatabase, WASQLiteOpenFactory, WASQLiteVFS } from '@powersync/web';
27+
28+
export const db = new PowerSyncDatabase({
29+
schema: AppSchema,
30+
database: new WASQLiteOpenFactory({
31+
dbFilename: 'exampleVFS.db',
32+
vfs: WASQLiteVFS.OPFSCoopSyncVFS,
33+
flags: {
34+
enableMultiTabs: typeof SharedWorker !== 'undefined'
35+
}
36+
}),
37+
flags: {
38+
enableMultiTabs: typeof SharedWorker !== 'undefined'
39+
}
40+
});
41+
```
42+
43+
2. **Disable Web Workers (Alternative)**: Set the `useWebWorker` flag to `false`, but note that this disables multi-tab support:
44+
45+
```js
46+
export const db = new PowerSyncDatabase({
47+
schema: AppSchema,
48+
database: {
49+
dbFilename: 'powersync.db'
50+
},
51+
flags: {
52+
useWebWorker: false
53+
}
54+
});
55+
```
1656

1757
## Tools
1858

usage/use-case-examples/high-performance-diffs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description: 'Efficiently get row changes using trigger-based table diffs (JS)'
99
While [basic/incremental watch queries](/usage/use-case-examples/watch-queries) enable reactive UIs by automatically re‑running queries when underlying data changes and returning updated results, they don't specify which individual rows were modified. To get these details, you can use [**differential watch queries**](/usage/use-case-examples/watch-queries#differential-watch-queries), which return a structured diff between successive query results. However, on large result sets they can be slow because they re‑run the query and compare full results (e.g., scanning ~1,000 rows to detect 1 new item). That’s why we introduced **trigger‑based table diffs**: a more performant approach that uses SQLite triggers to record changes on a table as they happen. This means that the overhead associated with tracking these changes overhead is more proportional to the number of rows inserted, updated, or deleted.
1010

1111
<Note>
12-
**JavaScript Only**: Trigger-based table diffs are available in the JavaScript SDKs starting from:
12+
**JavaScript Only**: Trigger-based table diffs are currently only supported in our JavaScript SDKs, starting from:
1313
* Web v1.26.0
1414
* React Native v1.24.0
1515
* Node.js v0.10.0

0 commit comments

Comments
 (0)