Skip to content

Commit 498f405

Browse files
fix(core): Conf parsing error always displays tauri.conf.json file name even when using toml or json5 (#10404)
* Conf parsing error displays `tauri.conf.json` when using toml or json5 Conf parsing error always displays `tauri.conf.json` as path, even when using `Tauri.toml` or `tauri.conf.json5` Example Error Message when using Tauri.toml: Error unable to parse toml Tauri config file at /Users/bla/repo/bla/bla/src-tauri/tauri.conf.json because invalid TOML value, did you mean to use a quoted string? at line 41 column 7 * merge changefile pr into main pr * Update and rename fix-conf-parsing-error-filepath to fix-conf-parsing-error-filepath.md --------- Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
1 parent 2a402b4 commit 498f405

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"tauri-utils": "patch:bug"
3+
---
4+
5+
Fixed an issue where configuration parsing errors always displayed 'tauri.conf.json' as the file path, even when using 'Tauri.toml' or 'tauri.conf.json5'.
6+
7+
The error messages now correctly shows the actual config file being used.

‎core/tauri-utils/src/config/parse.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ fn do_parse<D: DeserializeOwned>(
300300
#[cfg(feature = "config-json5")]
301301
{
302302
let raw = read_to_string(&json5)?;
303-
do_parse_json5(&raw, &path).map(|config| (config, json5))
303+
do_parse_json5(&raw, &json5).map(|config| (config, json5))
304304
}
305305

306306
#[cfg(not(feature = "config-json5"))]
@@ -312,7 +312,7 @@ fn do_parse<D: DeserializeOwned>(
312312
#[cfg(feature = "config-toml")]
313313
{
314314
let raw = read_to_string(&toml)?;
315-
do_parse_toml(&raw, &path).map(|config| (config, toml))
315+
do_parse_toml(&raw, &toml).map(|config| (config, toml))
316316
}
317317

318318
#[cfg(not(feature = "config-toml"))]

0 commit comments

Comments
 (0)