You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use Sentry in my electron project, I found a problem with exports map.
Screens
import
sentry's package json
esbuild output
@sentry/electron package
/main/index.js file
esbuild report that this import does not exist because of the package.json exports map (I think). But this module exists. esbuild is not searching for a "module" key inside the exports map.
BONUS
Side effect false positive
Because in the package.json, the project is marked as sideEffects: false, this file can't be imported. But this file is not sideEffects free.
Feel free to ask me any more details. Or just RTFM me 😄
The text was updated successfully, but these errors were encountered:
This package looks broken. The correct condition name for imports is import not module: https://nodejs.org/api/packages.html#conditional-exports. The name module is meaningless here. The package author should fix their broken exports map. They should also fix their incorrect sideEffects annotation.
You may be able to work around the incorrect exports map with --conditions=module and you may be able to work around the incorrect sideEffects annotation with --tree-shaking=ignore-annotations, but you should ideally get the package author to fix their broken package instead as those flags can have other negative side effects on your bundle. You can read more about those API options in the docs: https://esbuild.github.io/api/.
Closing this issue because it’s a problem with the package, not with esbuild.
Stack :
When trying to use Sentry in my electron project, I found a problem with exports map.
Screens
import
sentry's package json
esbuild output
@sentry/electron package
/main/index.js
fileesbuild report that this import does not exist because of the package.json exports map (I think). But this module exists. esbuild is not searching for a "module" key inside the exports map.
BONUS
Side effect false positive
Because in the package.json, the project is marked as
sideEffects: false
, this file can't be imported. But this file is not sideEffects free.Feel free to ask me any more details. Or just RTFM me 😄
The text was updated successfully, but these errors were encountered: