{"record":{"id":"7e8bf4464d0f5cf4","repo":"serverless/serverless","slug":"invalid-service-config-path","errorCode":"INVALID_SERVICE_CONFIG_PATH","errorMessage":"Invalid \"--config\" value: Unsupported file extension (expected one of: ${Array.from(supportedExtensions).join(', ')}","messagePattern":"Invalid \"--config\" value: Unsupported file extension \\(expected one of: (.+?)","errorType":"exception","errorClass":"ServerlessError","httpStatus":null,"severity":"error","filePath":"packages/serverless/lib/cli/resolve-configuration-path.js","lineNumber":32,"sourceCode":"  'mjs',\n  'cjs',\n  'ts',\n])\n\nexport default async (options = {}) => {\n  if (!options) options = {}\n  const cliOptions =\n    ensurePlainObject(options.options, { isOptional: true }) ||\n    resolveInput().options\n  const cwd = path.resolve(\n    ensureString(options.cwd, { isOptional: true }) || process.cwd(),\n  )\n  const customConfigName = cliOptions.config\n\n  if (customConfigName) {\n    const customConfigPath = path.resolve(cwd, customConfigName)\n    if (!supportedExtensions.has(path.extname(customConfigPath).slice(1))) {\n      throw new ServerlessError(\n        'Invalid \"--config\" value: Unsupported file extension ' +\n          `(expected one of: ${Array.from(supportedExtensions).join(', ')}`,\n        'INVALID_SERVICE_CONFIG_PATH',\n      )\n    }\n    const stats = await (async () => {\n      try {\n        return await fsp.stat(customConfigPath)\n      } catch (error) {\n        if (error.code === 'ENOENT') {\n          throw new ServerlessError(\n            `'Invalid \"--config\" value: Cannot find \"${customConfigName}\" in service folder`,\n            'INVALID_SERVICE_CONFIG_PATH',\n          )\n        }\n        throw new ServerlessError(\n          `Invalid \"--config\" value: \"${customConfigName}\" is not accessible: ${error.stack}`,\n          'INVALID_SERVICE_CONFIG_PATH',","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/serverless/serverless/blob/b9d7ea51c8cce57cff1207964b9b71123673081f/packages/serverless/lib/cli/resolve-configuration-path.js#L14-L50","documentation":"Error \"Invalid \"--config\" value: Unsupported file extension (expected one of: ${Array.from(supportedExtensions).join(', ')}\" thrown in serverless/serverless.","triggerScenarios":"Thrown at packages/serverless/lib/cli/resolve-configuration-path.js:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Point --config at a file with a supported extension such as .yml, .yaml, .json, .js, or .ts."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b9d7ea51c8cce57cff1207964b9b71123673081f","analyzedAt":"2026-08-13T04:14:40.386Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}