Skip to content
← Back to activity

Public problem

filestack-js: Object prototype error when importing in Vite/Rollup

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

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. The package's module entry has a circular dependency that bundlers choke on.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

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.

Source: https://github.com/filestack/filestack-js/issues/458

Source: https://github.com/filestack/filestack-js/issues/458