oraios/serena · error · ValueError
Unsupported Luau platform: {platform_type}. Expected one of:
Error message
Unsupported Luau platform: {platform_type}. Expected one of: {', '.join(sorted(SUPPORTED_PLATFORMS))} What it means
luau_lsp validates the 'platform' key in the language server's custom settings against SUPPORTED_PLATFORMS before building its workspace configuration or resolving support files. If the configured platform is not a known Luau platform (e.g. 'roblox'), a ValueError is raised at server initialization time so a misconfigured multiverse of Luau dialects is caught early rather than producing a broken server.
Source
Thrown at src/solidlsp/language_servers/luau_lsp.py:246
return "luau-lsp-linux-x86_64.zip"
if machine in ["aarch64", "arm64"]:
return "luau-lsp-linux-arm64.zip"
raise RuntimeError(
f"Unsupported Linux architecture: {machine}. "
"luau-lsp only provides linux-x86_64 and linux-arm64 binaries. "
"Please build from source: https://github.com/JohnnyMorganz/luau-lsp"
)
if system == "Darwin":
return "luau-lsp-macos.zip"
if system == "Windows":
return "luau-lsp-win64.zip"
raise RuntimeError(f"Unsupported operating system: {system}")
@staticmethod
def _get_platform_type(custom_settings: SolidLSPSettings.CustomLSSettings) -> str:
platform_type = custom_settings.get("platform", "roblox")
if platform_type not in SUPPORTED_PLATFORMS:
raise ValueError(f"Unsupported Luau platform: {platform_type}. Expected one of: {', '.join(sorted(SUPPORTED_PLATFORMS))}")
return platform_type
@staticmethod
def _get_roblox_security_level(custom_settings: SolidLSPSettings.CustomLSSettings) -> str:
security_level = custom_settings.get("roblox_security_level", "PluginSecurity")
if security_level not in SUPPORTED_ROBLOX_SECURITY_LEVELS:
raise ValueError(
f"Unsupported Luau Roblox security level: {security_level}. "
f"Expected one of: {', '.join(sorted(SUPPORTED_ROBLOX_SECURITY_LEVELS))}"
)
return security_level
@classmethod
def _get_workspace_configuration(cls, custom_settings: SolidLSPSettings.CustomLSSettings) -> dict[str, dict[str, str]]:
return {"platform": {"type": cls._get_platform_type(custom_settings)}}
def _create_dependency_provider(self) -> LanguageServerDependencyProvider:
return self.DependencyProvider(self._custom_settings, self._ls_resources_dir)View on GitHub (pinned to 7fcbca7e62)
Solutions
- Open src/solidlsp/language_servers/luau_lsp.py and check the SUPPORTED_PLATFORMS set for the exact accepted values
- Set the custom setting platform to one of the supported values (default is 'roblox')
- Remove the platform key entirely to fall back to the default 'roblox'
Example fix
// before
ls_settings = {"luau_lsp": {"platform": "luau-lang"}}
// after
ls_settings = {"luau_lsp": {"platform": "roblox"}} # or another value in SUPPORTED_PLATFORMS Defensive patterns
Strategy: validation
Validate before calling
SUPPORTED_PLATFORMS = {"roblox"} # check luau_lsp.py for exact set
platform = settings.get("platform", "roblox")
if platform not in SUPPORTED_PLATFORMS:
raise ValueError(f"platform must be one of {sorted(SUPPORTED_PLATFORMS)}, got {platform!r}") Type guard
def is_valid_platform(p) -> bool:
return isinstance(p, str) and p in SUPPORTED_PLATFORMS Try / catch
try:
ls = SolidLSP("luau")
except ValueError as e:
if "Unsupported Luau platform" in str(e):
logger.error("Fix custom_settings['platform']: %s", e)
raise Prevention
- Copy platform values only from SUPPORTED_PLATFORMS in luau_lsp.py
- Omit the platform key to accept the default
- Validate config dicts at load time, before constructing the language server
When it happens
Trigger: Calling SolidLSP for Luau with CustomLSSettings containing platform=<unknown value> (typo like 'roblox ' or 'ROBLOX', or a platform like 'standard'/'luau' that is not in SUPPORTED_PLATFORMS); the check runs in _get_platform_type which is invoked by _resolve_support_files and _get_workspace_configuration during setup.
Common situations: Copying settings from an old config file or blog post that used a renamed/removed platform value; typos in the platform string; assuming arbitrary strings are accepted because the setting is free-form JSON.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- Unsupported Luau Roblox security level: {security_level}. Ex
- Unknown language '{lang}'. Supported: {all_langs}
- Cannot use both fixed_tools and excluded_tools/included_opti
- Unknown language backend '{backend_str}': valid values are {
- Invalid line_ending: {value!r}. Valid values are: {valid}
AI-assisted analysis of oraios/serena@7fcbca7e62 (2026-08-29).
Data as JSON: /api/errors/3d18aa413c593d3a.
Report an issue: GitHub.