Closed gknapp closed 3 weeks ago
Change the store and window-state plugin to use the v2
branch. I think the migrate command currently can't handle git dependencies, which i guess it should considering that v1 plugins never got released...
Change the store and window-state plugin to use the
v2
branch. I think the migrate command currently can't handle git dependencies, which i guess it should considering that v1 plugins never got released...
I figured this might need changing - once updated, do I re-run migrate or another command?
Updated deps to:
tauri-plugin-store = { branch = "v2", git = "https://github.com/tauri-apps/plugins-workspace" }
tauri-plugin-window-state = { branch = "v2", git = "https://github.com/tauri-apps/plugins-workspace" }
once updated, do I re-run migrate or another command?
Hmm, probably re-run it. I'm not sure how well the migrate command handles failures like this right now so maybeee you have to reset the project to v1 again (assuming you have version control set up), change the plugins deps and run it again 🤔
I've re-organised main.rs
and lib.rs
per the migration docs. Looks like the migration worked through my tauri.conf.json
and extracted the allowlist
perms into capabilities/migrated.json
.
I'm just updating shell plugin code. I'll raise a separate issue if I run into trouble there. I'll leave this open until I get a running app stood up. Thanks for the help.
It appears the migration script did duplicate a permission from my v1 allow list:
"permissions": [
"core:default",
{
"identifier": "fs:scope",
"allow": [
"$APP/*",
"$DESKTOP/*",
"$RESOURCE/*"
]
},
"core:window:allow-set-title",
"shell:allow-execute",
"shell:allow-open",
"shell:allow-open", // dupe
"dialog:allow-open",
"dialog:allow-save",
{
"identifier": "http:default",
"allow": [{ "url": "file:///" }]
}
]
During npm start
I'm seeing:
Permission fs:scope not found, expected one of core:app:default, ...
It's as if it can't see the fs:scope
object in capabilities/migrated.json
Compiling tauri-plugin-shell v2.0.0-rc.0
error: failed to run custom build command for `app v1.0.0 (C:\yyy\src-tauri)`
Caused by:
process didn't exit successfully: `C:\yyy\src-tauri\target\debug\build\app-d15e51f6b2c8c9a8\build-script-build` (exit code: 1)
--- stdout
cargo:rerun-if-env-changed=TAURI_CONFIG
cargo:rerun-if-changed=tauri.conf.json
cargo:rustc-check-cfg=cfg(desktop)
cargo:rustc-cfg=desktop
cargo:rustc-check-cfg=cfg(mobile)
cargo:rustc-env=TAURI_ANDROID_PACKAGE_NAME_APP_NAME=yyy
cargo:rustc-env=TAURI_ANDROID_PACKAGE_NAME_PREFIX=yyy
cargo:rustc-check-cfg=cfg(dev)
cargo:rustc-cfg=dev
cargo:PERMISSION_FILES_PATH=C:\yyy\src-tauri\target\debug\build\app-9ea48d623f55e621\out\app-manifest\__app__-permission-files
cargo:rerun-if-changed=capabilities
Permission fs:scope not found, expected one of core:app:default,
The V2 docs state the variables I've used (see previous post) are still valid in V2.
During
npm start
I'm seeing:
Permission fs:scope not found, expected one of core:app:default, ...
It's as if it can't see the
fs:scope
object incapabilities/migrated.json
Compiling tauri-plugin-shell v2.0.0-rc.0 error: failed to run custom build command for `app v1.0.0 (C:\yyy\src-tauri)` Caused by: process didn't exit successfully: `C:\yyy\src-tauri\target\debug\build\app-d15e51f6b2c8c9a8\build-script-build` (exit code: 1) --- stdout cargo:rerun-if-env-changed=TAURI_CONFIG cargo:rerun-if-changed=tauri.conf.json cargo:rustc-check-cfg=cfg(desktop) cargo:rustc-cfg=desktop cargo:rustc-check-cfg=cfg(mobile) cargo:rustc-env=TAURI_ANDROID_PACKAGE_NAME_APP_NAME=yyy cargo:rustc-env=TAURI_ANDROID_PACKAGE_NAME_PREFIX=yyy cargo:rustc-check-cfg=cfg(dev) cargo:rustc-cfg=dev cargo:PERMISSION_FILES_PATH=C:\yyy\src-tauri\target\debug\build\app-9ea48d623f55e621\out\app-manifest\__app__-permission-files cargo:rerun-if-changed=capabilities Permission fs:scope not found, expected one of core:app:default,
The V2 docs state the variables I've used (see previous post) are still valid in V2.
I think the migration added the FS scope but not the FS plugin. I'll run through the list of changes needed here today.
During
npm start
I'm seeing:Permission fs:scope not found, expected one of core:app:default, ...
It's as if it can't see thefs:scope
object incapabilities/migrated.json
Compiling tauri-plugin-shell v2.0.0-rc.0 error: failed to run custom build command for `app v1.0.0 (C:\yyy\src-tauri)` Caused by: process didn't exit successfully: `C:\yyy\src-tauri\target\debug\build\app-d15e51f6b2c8c9a8\build-script-build` (exit code: 1) --- stdout cargo:rerun-if-env-changed=TAURI_CONFIG cargo:rerun-if-changed=tauri.conf.json cargo:rustc-check-cfg=cfg(desktop) cargo:rustc-cfg=desktop cargo:rustc-check-cfg=cfg(mobile) cargo:rustc-env=TAURI_ANDROID_PACKAGE_NAME_APP_NAME=yyy cargo:rustc-env=TAURI_ANDROID_PACKAGE_NAME_PREFIX=yyy cargo:rustc-check-cfg=cfg(dev) cargo:rustc-cfg=dev cargo:PERMISSION_FILES_PATH=C:\yyy\src-tauri\target\debug\build\app-9ea48d623f55e621\out\app-manifest\__app__-permission-files cargo:rerun-if-changed=capabilities Permission fs:scope not found, expected one of core:app:default,
The V2 docs state the variables I've used (see previous post) are still valid in V2.
I think the migration added the FS scope but not the FS plugin. I'll run through the list of changes needed here today.
from my test it does add the FS plugin, maybe it's because yours failed?
Update: Cut a new test branch from my v1 branch and ran RC4, can see it's completed and installed tauri-plugin-fs = "2.0.0-rc.0"
and others to my Cargo.toml deps.
My migration did fail, how do I add the FS plugin - add it to my
Cargo.toml
dependencies?My current deps:
[dependencies] base64 = "0.22.0" minifier = "0.3.0" minify-html = "0.15.0" scraper = "0.19.1" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" tauri = { version = "2.0.0-rc", features = [] } tauri-plugin-dialog = "2.0.0-rc.0" tauri-plugin-shell = "2.0.0-rc.0" tauri-plugin-store = { branch = "v2", git = "https://github.com/tauri-apps/plugins-workspace" } tauri-plugin-window-state = { branch = "v2", git = "https://github.com/tauri-apps/plugins-workspace" } thiserror = "1.0"
npm run tauri migrate
exits with no output, whatever it's checking, I presume it sees my project as migrated and takes no action.I've moved my v1
main.rs
->lib.rs
and recreatedmain.rs
per the migration guide.
Should the migration script add the src-tauri/gen
directory to .gitignore
if the ignore file exists?
No, currently the suggestion is to commit the gen folder too. without gen/schemas though (which is what the default gitignore file does).
Describe the bug
Following the commands on the RC blog post, I ran
npm run tauri migrate
after installing@tauri-apps/cli@next
.NPM deps were upgraded to ^2.0.0-rc.0 including
@tauri-apps/plugins-*
Encountered the error:
Reproduction
From a 1.6.0 app using the following cargo deps:
Expected behavior
migrate without encountering errors. Full error encountered:
Full
tauri info
outputStack trace
Additional context
Ran npm commands from gitbash terminal.