filestack-js icon indicating copy to clipboard operation
filestack-js copied to clipboard

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

Open Codigo-Fuentes opened this issue 4 years ago • 0 comments

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

Codigo-Fuentes avatar May 05 '21 17:05 Codigo-Fuentes