-
Notifications
You must be signed in to change notification settings - Fork 121
Description
- I have checked that the SDK documentation doesn't solve my issue.
- I have checked that the API documentation doesn't solve my issue.
- I have searched the Box Developer Forums and my issue isn't already reported (or if it has been reported, I have attached a link to it, for reference).
- I have searched Issues in this repo and my issue isn't already reported.
Description of the Issue
The code distributed in the lib-esm folder is not actually ES module compatible. It uses the node-specific require() syntax. While many bundlers are compatible with require, it can cause optimization bail-outs.
Looks like this was a regression which started in [email protected] (19.0.0 was using import/export syntax).
Steps to Reproduce
n/a
Expected Behavior
Code in lib-esm should use the import { } from './path' syntax.
Even the code from [email protected] was not fully ESM compatible (it did not include file extensions in import statements). A solution might be to use a rollup config that emits ESM syntax and maintains the existing src folder structure (per the glob-related suggestion in the Rollup guide: https://rollupjs.org/configuration-options/#input).
Error Message, Including Stack Trace
n/a
Screenshots
n/a
Versions Used
Typescript SDK: [email protected]
Platform: Browser
Node.js (if applicable): n/a