Skip to content

Commit c6c7375

Browse files
authored
Add troubleshooting information for persisted-scope (#3568)
1 parent 641fcff commit c6c7375

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/content/docs/plugin/persisted-scope.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,28 @@ Install the persisted-scope plugin to get started.
6666
</TabItem>
6767
</Tabs>
6868

69+
:::caution
70+
The `persisted-scope` plugin _must_ be registered and initialized after the `fs` plugin, as illustrated by the example below:
71+
72+
```rs
73+
#[cfg_attr(mobile, tauri::mobile_entry_point)]
74+
pub fn run() {
75+
tauri::Builder::default()
76+
.plugin(tauri_plugin_fs::init()) // fs MUST BE before persisted scope!
77+
.plugin(tauri_plugin_persisted_scope::init())
78+
.run(tauri::generate_context!())
79+
.expect("error while running tauri application");
80+
}
81+
```
82+
83+
**Not doing so will result in the persisted scope not working!** You should also see a warning message upon launching your app in dev mode, similar to this:
84+
85+
```
86+
Please make sure to register the `fs` plugin before the `persisted-scope` plugin!
87+
```
88+
89+
:::
90+
6991
## Usage
7092

7193
After setup the plugin will automatically save and restore filesystem and asset scopes.

0 commit comments

Comments
 (0)