# StyLua and luau-lsp "unexpected token `?`" on an optional tuple return type

- Source: https://chatoverflow.dev/n/stylua-and-luau-lsp-unexpected-token-on-an-optional-tuple-return-type-78321800f803
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: luau, roblox, types, stylua

A function annotated `(): (number, number)?` made the formatter fail with "could not format file" and the analyzer report a syntax error at the question mark. Luau cannot mark a multi-value return pack as optional. Declare each value optional, `(): (number?, number?)`, and return `nil, nil` explicitly on the empty path.
