{"record":{"id":"c273a5d0c81e469a","repo":"dbt-labs/dbt-core","slug":"failed-to-parse-value-of-field-as-path","errorCode":null,"errorMessage":"Failed to parse value of `{field}` as path.","messagePattern":"Failed to parse value of `(.+?)` as path\\.","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/dbt-runtime-macros/src/entry.rs","lineNumber":306,"sourceCode":"            format!(\"Failed to parse value of `{field}` as string.\"),\n        )),\n    }\n}\n\nfn parse_path(lit: syn::Lit, span: Span, field: &str) -> Result<Path, syn::Error> {\n    match lit {\n        syn::Lit::Str(s) => {\n            let err = syn::Error::new(\n                span,\n                format!(\n                    \"Failed to parse value of `{}` as path: \\\"{}\\\"\",\n                    field,\n                    s.value()\n                ),\n            );\n            s.parse::<syn::Path>().map_err(|_| err.clone())\n        }\n        _ => Err(syn::Error::new(\n            span,\n            format!(\"Failed to parse value of `{field}` as path.\"),\n        )),\n    }\n}\n\nfn parse_bool(bool: syn::Lit, span: Span, field: &str) -> Result<bool, syn::Error> {\n    match bool {\n        syn::Lit::Bool(b) => Ok(b.value),\n        _ => Err(syn::Error::new(\n            span,\n            format!(\"Failed to parse value of `{field}` as bool.\"),\n        )),\n    }\n}\n\nfn contains_impl_trait(ty: &syn::Type) -> bool {\n    match ty {","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-runtime-macros/src/entry.rs#L288-L324","documentation":"Raised by parse_path in crates/dbt-runtime-macros/src/entry.rs when the attribute option's value is not a string literal at all. parse_path only handles `syn::Lit::Str`; any other literal kind (integer, bool, byte string, etc.) passed to a path-valued option produces this error at compile time.","triggerScenarios":"Passing a non-string literal to a path-valued macro option, e.g. `crate = 123`, `crate = true`, or an unquoted bareword that syn lexes as a non-string literal.","commonSituations":"Forgetting the quotes around the crate/path value in a `#[...]` attribute; writing `crate = my_crate` instead of `crate = \"my_crate\"`; IDE auto-completion inserting an unquoted token.","solutions":["Wrap the value in double quotes so it is a string literal: `crate = \"my_crate\"`","Ensure the option expects a path and you are passing a quoted path, not an identifier or number","Re-read the macro documentation for the exact expected value syntax"],"exampleFix":"// before\n#[dbt::main(crate = my_crate)]\n// after\n#[dbt::main(crate = \"my_crate\")]","handlingStrategy":"validation","validationCode":"// ensure the option value is a quoted string literal before handing it to the macro\n// attribute check: value must start and end with double quotes\nfn is_quoted_string(raw: &str) -> bool {\n    raw.starts_with('\"') && raw.ends_with('\"') && raw.len() >= 2\n}\n// e.g. attribute should read: crate = \"my_crate\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Quote every macro attribute value: `crate = \"name\"`, never a bare token","Do not pass numbers or booleans to path/string options","Review macro docs for which options take paths vs strings vs bools"],"tags":["proc-macro","rust","attribute","type-mismatch"],"backgroundTag":"invalid-argument-format","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}