Package + Version
Version:
@sentry/integrations@6.2.5
Description
Using require breaks ESM builds.
We're evaluating snowpack which requires all deps to be be ESM compatible. Everything in our project works except for @sentry/integrations.
Best we can tell it's due to using CommonJS's require:
|
const localForage = require('localforage'); |

Without being overly prescriptive it seems like the import * as localForageType from 'localforage'; could be used and no require is necessary.
|
import * as localForageType from 'localforage'; |
Provide a link to the affected event from your Sentry accountn/aPackage + Version
@sentry/browser@6.2.5n/a@sentry/noden/araven-jsn/araven-node(raven for node)@sentry/integrations@6.2.5Version:
Description
Using
requirebreaks ESM builds.We're evaluating snowpack which requires all deps to be be ESM compatible. Everything in our project works except for
@sentry/integrations.Best we can tell it's due to using CommonJS's
require:sentry-javascript/packages/integrations/src/offline.ts
Line 7 in d98f5d6
Without being overly prescriptive it seems like the
import * as localForageType from 'localforage';could be used and norequireis necessary.sentry-javascript/packages/integrations/src/offline.ts
Line 4 in d98f5d6