getsentry / sentry-javascript-bundler-plugins

JavaScript Bundler Plugins for Sentry
https://sentry.io
BSD 3-Clause "New" or "Revised" License
141 stars 36 forks source link

sentry/webpack-plugin upload sourcemap oom #563

Closed oopses closed 4 months ago

oopses commented 4 months ago

node: 18.14.0 32 win10 webpack: 5.87.0 sentry/webpack-plugin: 2.14.1

build in jenkins,always prompt:


[sentry-webpack-plugin] Warning: Didn't find any matching sources for debug ID upload. Please check the `sourcemaps.assets` option.
鈭� building main process
> building renderer process
> Found 2 files
> Analyzing 2 sources
> Rewriting sources
> Adding source map references
> Bundled 2 files for upload
> Bundle ID: 6961e02e-d7a3-5e59-8bcc-92eae130e5a4
> Uploaded files to Sentry
> File upload complete (processing pending on server)
> Dist: None
> Upload type: artifact bundle

Source Map Upload Report
  Minified Scripts
    ~/main.js (no sourcemap ref)
      - warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/main.js)
    ~/scriptWorker.js (no sourcemap ref)
      - warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/scriptWorker.js)

#
# Fatal error in , line 0
# Fatal process out of memory: Zone
#
#
#
#FailureMessage Object: 0C4CAAF8
error Command failed with exit code 2147483651.


Source Map Upload Report
  Minified Scripts
    ~/main.js (no sourcemap ref)
      - warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/main.js)
    ~/scriptWorker.js (no sourcemap ref)
      - warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/scriptWorker.js)

<--- Last few GCs --->

[22048:407ECD98]    12662 ms: Mark-sweep (reduce) 395.2 (429.7) -> 261.5 (402.2) MB, 128.6 / 0.0 ms  (average mu = 0.984, current mu = 0.971) last resort; GC in old space requested
[22048:407ECD98]    12842 ms: Mark-sweep (reduce) 261.5 (402.2) -> 261.0 (308.0) MB, 180.3 / 0.0 ms  (average mu = 0.953, current mu = 0.000) last resort; GC in old space requested

<--- JS stacktrace --->

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
error Command failed with exit code 134.```
lforst commented 4 months ago

Hi, we can practically rule out that the webpack plugin is causing the OOM. It is more likely that Webpack is consuming a lot of memory generating sourcemaps.

You can try and exclude certain files from being sourcemapped in your build with webpack config, or provide your build server with more memory.

oopses commented 4 months ago

Hi, we can practically rule out that the webpack plugin is causing the OOM. It is more likely that Webpack is consuming a lot of memory generating sourcemaps.

You can try and exclude certain files from being sourcemapped in your build with webpack config, or provide your build server with more memory.

I closed the sentry sourcemap upload separately, and the packaging would not report an error

lforst commented 4 months ago

What do you mean by "closed" the upload?

oopses commented 4 months ago

What do you mean by "closed" the upload?


      const sourcemaps = {
        assets: ['dist/electron/*.js.map'],
        ignore: ['node_modules'],
      }
      if(isProd){
        sourcemaps.filesToDeleteAfterUpload = 'dist/electron/*.js.map'
      }```

I changed the CLI on that device and uploaded it.
oopses commented 4 months ago

What do you mean by "closed" the upload?

      const sourcemaps = {
        assets: ['dist/electron/*.js.map'],
        ignore: ['node_modules'],
      }
      if(isProd){
        sourcemaps.filesToDeleteAfterUpload = 'dist/electron/*.js.map'
      }```

I changed the CLI on that device and uploaded it.

Found the problem. The problem should be in the Minified Scripts step, which caused the oom