electron-userland / electron-userland/electron-webpack

Adding @sentry/electron breaks build with "Critical dependency..."

Open
#209 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
902
Forks
168
PR merge metrics
No merged PRs in 30d

Description

When you add `@sentry/electron` and import it anywhere, builds break with "Critical dependency: the request of a dependency is an expression".

Simply:
```
yarn add --dev @sentry/electron
```

And add `import { init as SentryInit } from '@sentry/electron'` to src/main.js

This causes the following two warnings to be thrown:
```
yarn dev
... ... ...
WARNING in ./node_modules/@sentry/electron/dist/main/context.js 80:11-31
Critical dependency: the request of a dependency is an expression
@ ./node_modules/@sentry/electron/dist/main/integrations/electron.js @ ./node_modules/@sentry/electron/dist/main/integrations/index.js
@ ./node_modules/@sentry/electron/dist/main/index.js
@ ./node_modules/@sentry/electron/dist/dispatch.js
@ ./node_modules/@sentry/electron/dist/index.js
@ ./src/main/index.js @ multi ./node_modules/electron-webpack/out/electron-main-hmr/main-hmr ./node_modules/electron-webpack/out/configurators/vue/vue-main-dev-entry.js ./src/main/index.js

WARNING in ./node_modules/encoding/lib/iconv-loader.js 9:12-34
Critical dependency: the request of a dependency is an expression
@ ./node_modules/encoding/lib/encoding.js
@ ./node_modules/electron-fetch/lib/index.es.js
@ ./node_modules/@sentry/electron/dist/main/uploader.js
@ ./node_modules/@sentry/electron/dist/main/backend.js
@ ./node_modules/@sentry/electron/dist/main/index.js
@ ./node_modules/@sentry/electron/dist/dispatch.js
@ ./node_modules/@sentry/electron/dist/index.js
@ ./src/main/index.js
@ multi ./node_modules/electron-webpack/out/electron-main-hmr/main-hmr ./node_modules/electron-webpack/out/configurators/vue/vue-main-dev-entry.js ./src/main/index.js
```

I'm a bit stuck on this... Any suggestions / comments / hints / tips welcome! Happy to provide any additional info as needed.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.