Budibase/budibase · error

Unable to determine delimiter

Error message

Unable to determine delimiter

What it means

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.

Source

Thrown at packages/backend-core/src/csv/index.ts:76

          if (row[header] === undefined || row[header] === "") {
            row[header] = null
          }
        }
      }

      if (headerMismatch) {
        continue
      }

      return result
    } catch (err) {
      // Splitting on the wrong delimiter sometimes throws CSV parsing error (eg
      // unterminated strings), which tells us we've picked the wrong delimiter
      continue
    }
  }

  throw new Error("Unable to determine delimiter")
}

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Inspect and clean the file: remove BOM, fix quoting, ensure consistent line endings
  2. Re-export the source data with a standard delimiter (comma or semicolon) and UTF-8 encoding
  3. Pre-validate the file (non-empty, contains expected delimiter characters) before calling
  4. If the format is genuinely unsupported, add the delimiter to the candidate list

Example fix

// before
const data = jsonFromCsvString(rawUpload)
// after
const cleaned = rawUpload.replace(/^\uFEFF/, "").trim()
if (!cleaned) throw new Error("Empty CSV upload")
const data = jsonFromCsvString(cleaned)
Defensive patterns

Strategy: validation

Validate before calling

const cleaned = input.replace(/^\uFEFF/, "").trim()
if (!cleaned || ![,;\t].some(d => cleaned.includes(d))) {
  throw new Error("Input does not look like delimited CSV data")
}
const result = jsonFromCsvString(cleaned)

Type guard

const looksLikeCsv = (s: string): boolean =>
  !!s.trim() && /[,,;\t]/.test(s)

Try / catch

try {
  const data = jsonFromCsvString(csvString)
} catch (err) {
  if (err.message === "Unable to determine delimiter") {
    // surface 'unsupported file format' to the user with the raw file
  } else throw err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29). Data as JSON: /api/errors/5dfea674ed86e414. Report an issue: GitHub.