ember-auto-import icon indicating copy to clipboard operation
ember-auto-import copied to clipboard

Production source maps contain no `sourcesContent`

Open Turbo87 opened this issue 4 years ago • 1 comments

In the default configuration the generated sourcemaps for production builds with webpack 5 and ember-auto-import 2 don't seem to contain the sourcesContent key. This causes bug tracking services like Sentry to try to download the original file based on the sources content. Since the files in sources are only virtual this does not work though, which means that Sentry can't fully resolve the stack traces.

I've found a workaround by explicitly setting the devtool option of webpack (see https://github.com/rust-lang/crates.io/pull/3678):

  // ember-cli-build.js

  let env = EmberApp.env();
  let isProd = env === 'production';

  let app = new EmberApp(defaults, {
    autoImport: {
      webpack: {
        devtool: isProd ? 'source-map' : 'eval-source-map',
      },
    },
  },

I'm wondering if that should be made a default in ember-auto-import to avoid these kinds of issues on Sentry.

Turbo87 avatar Jun 06 '21 07:06 Turbo87

This does seem like a good default (and one that's easy to override if people disagree).

ef4 avatar Jun 07 '21 12:06 ef4