#[Alpha] -- path join error "Command join not found"

41 messages · Page 1 of 1 (latest)

languid ice
#

Hello,

Updating my app to the latest Alpha and getting the following error:
Unhandled Promise Rejection: Command join not found

I'm using it like this

import { join } from '@tauri-apps/api/path'
const path = await join('folder', 'filename.jpg')

I have already removed allowlist from tauri.conf.json. I don't see path as a 2.0.0-alpha plugin, so it seems like it's still in the core api? When I console.log(join) it contains a function too.

Is there a commit or PR that I could look at to see how path.join has changed? Thank you!

shell rivet
#

what’s the version of your api package?

#

tauri-apps/api

languid ice
#

On the JS side? "@tauri-apps/api": "^2.0.0-alpha.4",

#

Yeah, also that version is in package-lock.json

shell rivet
#

and your tauri crate is on latest too?

#

alpha.9 i believe

languid ice
#

Yeah

[build-dependencies]
tauri-build = { version = "2.0.0-alpha.5", features = [] }

[dependencies]
tauri = { version = "2.0.0-alpha.9", features = ["macos-private-api"] }
tauri-plugin-window-state = "2.0.0-alpha"
tauri-plugin-window = "2.0.0-alpha"
tauri-plugin-global-shortcut = "2.0.0-alpha"
tauri-plugin-fs = "2.0.0-alpha"
tauri-plugin-app = "2.0.0-alpha"
shell rivet
#

ok I can reproduce, let me take a look

#

ahh it's a mistake in the feature flags..

languid ice
#

I'm seeing that other filesystem-like things also are throwing errors, like await appDataDir()

shell rivet
#

for the file system API you need to use the plugin

languid ice
#

Right, I'm using the new fs plugin. Was trying to be helpful by trying out other stuff from path and noticed that method also didn't like it. Sounds like you found something with feature flags though?

Appreciate you taking a look @shell rivet, very much so!

shell rivet
#

to use it, change your Cargo.toml:

[dependencies]
tauri = { git = "https://github.com/tauri-apps/tauri/", branch = "fix/path-api" }

[patch.crates-io]
tauri = { git = "https://github.com/tauri-apps/tauri/", branch = "fix/path-api" }
languid ice
#

Crap that was fast! @shell rivet you're a true hero. Thank you.

shell rivet
#

thanks for the report ❤️

languid ice
#

Anytime. I wasn't sure if this was a bug or I was just poking the alpha in a bad spot 😂

shell rivet
#

😄

#

we moved too many things

languid ice
#

The move to plugins makes things easier to find imo -- I like that style of opt-in too. Confusing at first but it will be less so to new users. Great call!

shell rivet
#

yeah that was the goal

#

and we'll try to guide the user on the migration as much as possible

languid ice
#

Yeah, I realize I'm gonna run into stuff and that I'm early... feel guilty asking about stuff being broken, so really trying to investigate everything as much as I can beforehand.

shell rivet
#

no problem, you help us a lot with this

#

you're early but I think you landed at a good spot 😄 we won't have a huge breaking change like the plugin migration anymore

languid ice
#

Love Tauri already. Very enjoyable and thanks again to you and the team! Excited about building more stuff on it!

#

Is there a config entry in the tauri.conf.json to specify whitelisted paths for the fs plugin now that allowlist is gone?

shell rivet
#

not yet

#

we’re still designing it

languid ice
#

any workaround or "whitelist all" for dev until then? Forbidden path but everything else in my app now working

shell rivet
#

for now all APIs are allowed

#

but you need to configure the scopes

languid ice
#

So are you saying to do that with app.fs_scope() manually since it no longer reads from tauri.conf.json? Thanks

shell rivet
#

it does read

#

but it was moved

#

it’s undocumented right now

#

but it’s under plugins > fs > scope

#

instead of allowlist > fs > scope

languid ice
#

OHH! I tried a bunch of stuff but not plugins ❤️ Thank you so much!

shell rivet
#

if you still have the v1 config, you can run the ‘tauri migrate’ command and it’ll do the config migration for you