{"id":"baae848bbde0331a","repo":"gohugoio/hugo","slug":"must-not-provide-more-arguments-than-resource-obje","errorCode":null,"errorMessage":"must not provide more arguments than resource object and options","messagePattern":"must not provide more arguments than resource object and options","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"tpl/css/css.go","lineNumber":110,"sourceCode":"\t})\n}\n\n// Quoted returns a string that needs to be quoted in CSS.\nfunc (ns *Namespace) Quoted(v any) css.QuotedString {\n\ts := cast.ToString(v)\n\treturn css.QuotedString(s)\n}\n\n// Unquoted returns a string that does not need to be quoted in CSS.\nfunc (ns *Namespace) Unquoted(v any) css.UnquotedString {\n\ts := cast.ToString(v)\n\treturn css.UnquotedString(s)\n}\n\n// PostCSS processes the given Resource with PostCSS.\nfunc (ns *Namespace) PostCSS(args ...any) (resource.Resource, error) {\n\tif len(args) > 2 {\n\t\treturn nil, errors.New(\"must not provide more arguments than resource object and options\")\n\t}\n\n\tr, m, err := resourcehelpers.ResolveArgs(args)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ns.postcssClient.Process(r, m)\n}\n\n// TailwindCSS processes the given Resource with tailwindcss.\nfunc (ns *Namespace) TailwindCSS(args ...any) (resource.Resource, error) {\n\tif len(args) > 2 {\n\t\treturn nil, errors.New(\"must not provide more arguments than resource object and options\")\n\t}\n\n\tr, m, err := resourcehelpers.ResolveArgs(args)\n\tif err != nil {","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/gohugoio/hugo/blob/8a468df065a75c1c7cf9f6850f32148746590ea5/tpl/css/css.go#L92-L128","documentation":"css.PostCSS, css.TailwindCSS (and css.Sass via ResolveArgs) accept at most two arguments: the resource to transform and an optional options map. Because these are variadic template functions, Hugo validates the count explicitly and rejects three or more arguments before resolving them.","triggerScenarios":"Calling {{ $r | css.PostCSS $opts $extra }} or css.TailwindCSS with more than two values — commonly from piping a resource while also passing it positionally, or splitting a dict into multiple arguments.","commonSituations":"Template authors pass options as separate key/value arguments instead of one dict, or migrate from an older pattern and leave a stray argument; pipelines like {{ css.PostCSS \"postcss.config.js\" $r $opts }} also trip it.","solutions":["Collapse all options into a single dict: {{ $r = $r | css.PostCSS (dict \"config\" \"postcss.config.js\") }}.","Remember piping supplies the resource as the last argument — don't also pass it explicitly.","Check the function docs at gohugo.io/functions/css/ for the exact signature."],"exampleFix":"{{/* before */}}\n{{ $css := css.PostCSS $r \"postcss.config.js\" true }}\n\n{{/* after */}}\n{{ $css := $r | css.PostCSS (dict \"config\" \"postcss.config.js\") }}","handlingStrategy":"validation","validationCode":"{{/* Correct: at most (options, resource) — not extra args */}}\n{{ $opts := dict \"transpiler\" \"dartsass\" \"targetPath\" \"css/main.css\" }}\n{{ $css := resources.Get \"sass/main.scss\" | css.Sass $opts }}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["css.Sass/css.TailwindCSS accept only an options dict plus the piped resource — collapse settings into one dict","Don't pass positional extras; put everything in the options map","Check the function signature in Hugo docs when migrating from older toCSS call styles"],"tags":["hugo","css","postcss","tailwind","template-functions"],"analyzedSha":"8a468df065a75c1c7cf9f6850f32148746590ea5","analyzedAt":"2026-07-31T21:23:07.045Z","schemaVersion":2}