-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] Platform-Specific Configuration seems broken #9607
Comments
Works fine on my Windows machine, can you please update your tauri dependencies and also the cli? if still doesn't work please provide a minimal reproduction repo. |
Updated and re-tested... ..unfortunately issues persist. For some reason Rust only allowed me to do Beta 13 when building ( see new tauri info above ) Added reproduction of the 5 issues I found - let me know if I need to add anything else ( pls bear with me - new at this ) |
@amrbashir My apologies - seems I was mistaken ! - conf files loads... ..it's the "URL" that only works in dev...not in build: See windows section below - "url": "/indexDesktop.html" When I do "pnpm tauri dev" it loads indexDesktop.html See below my "tauri.macos.conf.json" file: { |
@amrbashir Also - it seems when I do "pnpm tauri android dev" it loads "tauri.macos.conf.json" instead of "tauri.android.conf.json" If I force it with "pnpm tauri android dev -c tauri.android.conf.json" it loads "tauri.android.conf.json" ..but again - when I do "pnpm tauri android build" or "pnpm tauri build" it always loads index.html and ignores the "url" i set in the "tauri.android.conf.json" or "tauri.macos.conf.json"... ..even when I force it with -c Am I doing something wrong here - or is it a bug ? |
Hmm, we had that problem once before already but it was fixed in #7802. Maybe we broke it again 🤔
As far as i know the whole window config is ignored on mobile (since it doesn't have the concept of a window) so it will always use devUrl and frontendDist respectively. |
@FabianLars Perhaps this is me doing it the wrong way... I'm trying to get "tauri.android.conf.json" to load indexMobile.html - and "tauri.macos.conf.json" to load indexDesktop.html ..so each platform can have different index.html files. ..but it seems macos only allow me to change the window URL in dev mode... ( not build ) ..and android ( that ignores the window section ) don't seem to allow a customised index.html at all ? ( after further checks, conf files seems to load fine - it's the url that I don't get to work - so sorry for the confusion ) |
I guess we could add a new config option |
@amrbashir That would be very useful... I'm writing an app that is very similar in core function on desktop vs mobile - but the UX / UI needs to be different due to screen size and use cases - hence the need for a custom index.html per platform. |
This looks like a bug after all, so no need for |
closes #9607 proc-macros are compiled for the current host target and so it read the config for current host target even when building for mobile. In another part of our codegen macros we used `TAURI_ENV_TARGET_TRIPLE` as a fallback but it is only set by the CLI and users using `cargo build` won't be able to generate the correct `Context`. This PR will parse config for each platform and generates an appropriate `Context` and genertes code that uses this context conditionaly using compilation flags `#[cfg]`
Describe the bug
Platform-Specific Configuration seems broken.
"pnpm tauri android dev" do not load "tauri.android.conf.json" ( broken )
"pnpm tauri android build" do not load "tauri.android.conf.json" ( broken )
"pnpm tauri android build -c tauri.android.conf.json" do not load "tauri.android.conf.json" ( broken )
"pnpm tauri android dev -c tauri.android.conf.json" do load "tauri.android.conf.json" ( works )
also
"pnpm tauri build" on macos do not load "tauri.macos.conf.json" ( broken )
"pnpm tauri build -c tauri.macos.conf.json" on macos do not load "tauri.macos.conf.json" ( broken )
"pnpm tauri dev" on macos do load "tauri.macos.conf.json" ( works )
Reproduction
Try "pnpm tauri android dev" to see it not load "tauri.android.conf.json"
Try "pnpm tauri android build" to see it not load "tauri.android.conf.json"
Try "pnpm tauri android build -c tauri.android.conf.json" to see it not load "tauri.android.conf.json"
Try "pnpm tauri build" on a mac to see it not load "tauri.macos.conf.json"
Try "pnpm tauri build -c tauri.macos.conf.json" to see it not load "tauri.macos.conf.json"
Expected behavior
If "tauri.macos.conf.json" or "tauri.android.conf.json" exist during build or dev - they should be used.
If I use -c or -config to specify use of "tauri.whatever.conf.json" - it should be used.
Full
tauri info
outputStack trace
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: