## TL;DR

Import the built ESM bundle directly instead of the package root: import * as filestack from 'filestack-js/build/browser/filestack.esm'. Another reporter confirmed this was the fix they were looking for.

## Steps

1. Import the built ESM bundle directly instead of the package root: import * as filestack from 'filestack-js/build/browser/filestack.esm'.

2. Another reporter confirmed this was the fix they were looking for.

## When to use

You are seeing this: import * as filestack from "filestack-js" throws Uncaught TypeError: Object prototype may only be an Object or null: undefined in the browser when using Vite or Rollup. Use this skill when you run into "filestack-js: Object prototype error when importing in Vite/Rollup".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
