EatSheet.xlsx
npm
A1
=IFERROR(open(file), fix(error.code))

Troubleshooting

Most EatSheet problems come from the file, how the worker loads, or the browser. Every failure is an EatSheetError with a stable code, so start by logging error.code.
try {
  const book = await openWorkbook(file);
} catch (error) {
  console.log(error.code, error.message);
}

Code or symptom

What it means
What to do
WORKER_FAILED
The browser couldn't start the worker. Usually the bundler didn't copy it, or a Content Security Policy blocked it.
Check the network tab for a failed worker-entry request. Allow it with worker-src 'self', or serve it yourself as shown below.
MALFORMED_FILE
The file is corrupt, or isn't a spreadsheet.
Open it in Excel and save it again. A wrong file extension also causes this.
LEGACY_XLS
It's an old binary .xls file.
Ask for .xlsx instead. EatSheet doesn't read .xls.
UNSAFE_FILE
The file is encrypted, or contains XML entities or path tricks.
Remove the password in Excel. Otherwise, treat the file as suspect.
LIMIT_EXCEEDED
The file is over a size limit.
Raise maxBytes or maxCells if you trust the source. Unzipped size has its own limit, which these options don't change: 50 times the file's size, from at least 32 MB per part and 64 MB in total up to at most 256 MB and 512 MB.
TIMEOUT
A worker call took over 30 seconds.
Pass { timeout: 60000 }, or 0 to turn the limit off.
NETWORK
The download failed. In the browser, this is often CORS.
Check that the host allows your origin, or load the file through your own server.
UNSUPPORTED_BROWSER
The browser lacks native decompression.
Use Chrome 103+, Firefox 113+ or Safari 16.4+.
CLOSED
The workbook was used after book.close().
Cancel pending draws when you close it. The framework guides show how.

Serve the worker yourself

If your build doesn't copy the worker, as with Angular's production build, copy the .js files from node_modules/eatsheet/lib into your public folder and pass the worker in:
const worker = new Worker('/eatsheet/worker-entry.js', { type: 'module' });
const book = await openWorkbook(file, { worker });

The file opens but looks wrong

Symptom

Likely cause
No borders, or the grid looks unstyled
The stylesheet is missing. Import eatsheet/eatsheet.css.
Fonts, colours or fills are missing
A Content Security Policy is blocking inline styles. Add style-src 'unsafe-inline', or check that a sanitizer isn't removing them.
Scrolling does nothing, or rows stop appearing
The container needs a fixed height and overflow: auto, and you need to redraw on scroll with the current scrollTop.
A formula shows an old value
EatSheet shows Excel's saved result for functions it doesn't calculate. cell.status and cell.reason say why.
Dates appear as numbers when reading cells
cell.value is Excel's serial number, and cell.style.numFmt decides how it displays. renderSheet formats it for you.
Charts or images are missing
EatSheet doesn't show these yet.
inspect(book) lists anything EatSheet couldn't render or calculate in a file. Still stuck? Email eatsheet.js@gmail.com, or check the file for a bug.