{"record":{"id":"5dfea674ed86e414","repo":"Budibase/budibase","slug":"unable-to-determine-delimiter","errorCode":null,"errorMessage":"Unable to determine delimiter","messagePattern":"Unable to determine delimiter","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/backend-core/src/csv/index.ts","lineNumber":76,"sourceCode":"          if (row[header] === undefined || row[header] === \"\") {\n            row[header] = null\n          }\n        }\n      }\n\n      if (headerMismatch) {\n        continue\n      }\n\n      return result\n    } catch (err) {\n      // Splitting on the wrong delimiter sometimes throws CSV parsing error (eg\n      // unterminated strings), which tells us we've picked the wrong delimiter\n      continue\n    }\n  }\n\n  throw new Error(\"Unable to determine delimiter\")\n}\n","sourceCodeStart":58,"sourceCodeEnd":78,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/backend-core/src/csv/index.ts#L58-L78","documentation":"jsonFromCsvString tries candidate delimiters (e.g. comma, semicolon, tab) by parsing the input and picks the first that parses without error. If every candidate fails or produces invalid parses, it cannot decide which delimiter the file uses and throws.","triggerScenarios":"Passing a CSV string that fails to parse under all supported delimiters — malformed rows, unterminated quoted strings, wrong encoding/line endings, or an empty/non-CSV payload.","commonSituations":"User-uploaded CSV exports from exotic tools using unsupported delimiters (pipe, caret), files with BOM or mixed encodings, truncated uploads, or passing JSON/plain text to a CSV importer.","solutions":["Inspect and clean the file: remove BOM, fix quoting, ensure consistent line endings","Re-export the source data with a standard delimiter (comma or semicolon) and UTF-8 encoding","Pre-validate the file (non-empty, contains expected delimiter characters) before calling","If the format is genuinely unsupported, add the delimiter to the candidate list"],"exampleFix":"// before\nconst data = jsonFromCsvString(rawUpload)\n// after\nconst cleaned = rawUpload.replace(/^\\uFEFF/, \"\").trim()\nif (!cleaned) throw new Error(\"Empty CSV upload\")\nconst data = jsonFromCsvString(cleaned)","handlingStrategy":"validation","validationCode":"const cleaned = input.replace(/^\\uFEFF/, \"\").trim()\nif (!cleaned || ![,;\\t].some(d => cleaned.includes(d))) {\n  throw new Error(\"Input does not look like delimited CSV data\")\n}\nconst result = jsonFromCsvString(cleaned)","typeGuard":"const looksLikeCsv = (s: string): boolean =>\n  !!s.trim() && /[,,;\\t]/.test(s)","tryCatchPattern":"try {\n  const data = jsonFromCsvString(csvString)\n} catch (err) {\n  if (err.message === \"Unable to determine delimiter\") {\n    // surface 'unsupported file format' to the user with the raw file\n  } else throw err\n}","preventionTips":["Validate uploads are non-empty, UTF-8, BOM-free before parsing","Standardize exports to comma/semicolon delimiters","Detect unsupported delimiters (pipe, etc.) in a pre-check step"],"tags":["csv","parsing","import"],"backgroundTag":"csv-delimiter-detection-failed","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}