Git Product home page Git Product logo

Comments (3)

alanbsmith avatar alanbsmith commented on May 31, 2024

I'm not familiar with Sentry source maps. Why not just use Webpack's built-in source maps?

https://webpack.github.io/docs/configuration.html#devtool

from react-webpack-rails.

aymericbouzy avatar aymericbouzy commented on May 31, 2024

My sourcemaps are emitted by Webpack just fine. My issue is with providing them to Sentry. Sentry offers two ways :

  • making them publicly available (discouraged)
  • publishing them to their server as part of deployment

The second option I find difficult, because I don't really understand the deployment flow and how to add a step to publish the source maps to Sentry (I'm using Heroku and the deployment guide you provided)

The first option is the one I tried. I therefore added the SourceMapDevToolPlugin in my production.config.js file :

const Webpack = require('webpack');
const config = require('./../webpack.config');

config.plugins.push(
  new Webpack.DefinePlugin({'process.env': {'NODE_ENV': '"production"'}}),
  new Webpack.SourceMapDevToolPlugin({
    filename: '../../../public/assets/javascripts/react_bundle.map.js'
  })
);

module.exports = config;

This is fine, my sourcemap file ends up in the public directory, ready to be served to Sentry. But the soucemap comment at the end of my file reads:

// # sourceMappingURL=../../../public/assets/javascripts/react_bundle.map.js

And I don't know how to make it read :

// # sourceMappingURL=/assets/javascripts/react_bundle.map.js

Both options suggested by Sentry have proven a dead end for me, and I was wondering if you had any advice on the correct way to go :) Thanks !

from react-webpack-rails.

aymericbouzy avatar aymericbouzy commented on May 31, 2024

Wait ... I'm in the wrong repo. I meant to publish in react_webpack_rails. So sorry ! Closing this.

from react-webpack-rails.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.