{"record":{"id":"3d18aa413c593d3a","repo":"oraios/serena","slug":"unsupported-luau-platform-platform-type-expect","errorCode":null,"errorMessage":"Unsupported Luau platform: {platform_type}. Expected one of: {', '.join(sorted(SUPPORTED_PLATFORMS))}","messagePattern":"Unsupported Luau platform: (.+?)\\. Expected one of: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/luau_lsp.py","lineNumber":246,"sourceCode":"                    return \"luau-lsp-linux-x86_64.zip\"\n                if machine in [\"aarch64\", \"arm64\"]:\n                    return \"luau-lsp-linux-arm64.zip\"\n                raise RuntimeError(\n                    f\"Unsupported Linux architecture: {machine}. \"\n                    \"luau-lsp only provides linux-x86_64 and linux-arm64 binaries. \"\n                    \"Please build from source: https://github.com/JohnnyMorganz/luau-lsp\"\n                )\n            if system == \"Darwin\":\n                return \"luau-lsp-macos.zip\"\n            if system == \"Windows\":\n                return \"luau-lsp-win64.zip\"\n            raise RuntimeError(f\"Unsupported operating system: {system}\")\n\n    @staticmethod\n    def _get_platform_type(custom_settings: SolidLSPSettings.CustomLSSettings) -> str:\n        platform_type = custom_settings.get(\"platform\", \"roblox\")\n        if platform_type not in SUPPORTED_PLATFORMS:\n            raise ValueError(f\"Unsupported Luau platform: {platform_type}. Expected one of: {', '.join(sorted(SUPPORTED_PLATFORMS))}\")\n        return platform_type\n\n    @staticmethod\n    def _get_roblox_security_level(custom_settings: SolidLSPSettings.CustomLSSettings) -> str:\n        security_level = custom_settings.get(\"roblox_security_level\", \"PluginSecurity\")\n        if security_level not in SUPPORTED_ROBLOX_SECURITY_LEVELS:\n            raise ValueError(\n                f\"Unsupported Luau Roblox security level: {security_level}. \"\n                f\"Expected one of: {', '.join(sorted(SUPPORTED_ROBLOX_SECURITY_LEVELS))}\"\n            )\n        return security_level\n\n    @classmethod\n    def _get_workspace_configuration(cls, custom_settings: SolidLSPSettings.CustomLSSettings) -> dict[str, dict[str, str]]:\n        return {\"platform\": {\"type\": cls._get_platform_type(custom_settings)}}\n\n    def _create_dependency_provider(self) -> LanguageServerDependencyProvider:\n        return self.DependencyProvider(self._custom_settings, self._ls_resources_dir)","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/luau_lsp.py#L228-L264","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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'"],"exampleFix":"// before\nls_settings = {\"luau_lsp\": {\"platform\": \"luau-lang\"}}\n// after\nls_settings = {\"luau_lsp\": {\"platform\": \"roblox\"}}  # or another value in SUPPORTED_PLATFORMS","handlingStrategy":"validation","validationCode":"SUPPORTED_PLATFORMS = {\"roblox\"}  # check luau_lsp.py for exact set\nplatform = settings.get(\"platform\", \"roblox\")\nif platform not in SUPPORTED_PLATFORMS:\n    raise ValueError(f\"platform must be one of {sorted(SUPPORTED_PLATFORMS)}, got {platform!r}\")","typeGuard":"def is_valid_platform(p) -> bool:\n    return isinstance(p, str) and p in SUPPORTED_PLATFORMS","tryCatchPattern":"try:\n    ls = SolidLSP(\"luau\")\nexcept ValueError as e:\n    if \"Unsupported Luau platform\" in str(e):\n        logger.error(\"Fix custom_settings['platform']: %s\", e)\n    raise","preventionTips":["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"],"tags":["luau","configuration","validation"],"backgroundTag":"invalid-config-value","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}