filestack / filestack-js

Official Javascript SDK for the Filestack API and content ingestion system.
https://www.filestack.com
MIT License
206 stars 76 forks source link

Mixing 'import' and 'require' causing issues with rollup #437

Open Codigo-Fuentes opened 3 years ago

Codigo-Fuentes commented 3 years ago

Expected behavior

The project builds without issue.

Actual behavior

Throws error:

ReferenceError: require is not defined at http://localhost:8080/_snowpack/pkg/filestack-js.v3.23.1.js:5135:22

Possible Solution

Snowpack developer: Usually this happens when a package tells us that it's ESM but it then still contains CJS require() calls. If a package tells us it's ESM we'll trust it, but in some cases that's not true.

Steps to Reproduce (for bugs)

Create a project with snowpack and typescript and attempt to build.

Additional Screenshots

Screen Shot 2021-05-05 at 2 35 57 PM Screen Shot 2021-05-05 at 2 36 10 PM Screen Shot 2021-05-05 at 2 36 26 PM

Context

use filestack in a project with snowpack and ts

Your Environment

filestack.js "version": "3.23.1", browser: chrome macos desktop