简体   繁体   中英

source maps are not present in the build

I am using https://github.com/react-boilerplate/react-boilerplate boilerplate for react project and I have to integrate sentry for error log reporting.

For this, I need to upload source-maps on sentry for debugging. The guide which I am following is https://docs.sentry.io/platforms/javascript/guides/react/config/sourcemaps/#webpack

And I am also using a plugin by sentry https://github.com/getsentry/sentry-webpack-plugin for automatically uploading source maps when we create build.

But, when I create build for the project using npm run build there are no source map present in static/js folder.

As far as I have seen, build contains a static folder which contains which contains html, css, js folders and inside js folder we have chunks and source map files like xyz.js.map.

So, how do I fix this?

I would suggest using the below commands to create a demo react app rather than using the above boiler plate

npx create-react-app my-app
cd my-app
npm start

Once you run npm run build you should get the desired files within build folder as you said.

Reference: https://reactjs.org/docs/create-a-new-react-app.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM