How to work with 2 environments


#1

We have a Vue project. We are making two production builds: one for our internal team and one for the live version. Live version have a “live.” prefix for all files.

I’m using the webpack plugin to upload sourcemaps. (I also see the sourcemaps -both live and dev- in the artifacts section - don’t know if this is relevant)

The problem is that the issues shows the correct sourcemap-based code that is generating the error only for the issues coming from the dev version.
Issues coming from live version are showing minified code.

I’m probably doing something wrong but I really don’t know what and how to do and the docs are not helping to clear the confusion.

This is my webpack config

var prefix = (process.env.VUE_APP_SENTRY_ENV == "live") ? "live." : ""
config.css.sourceMap = false
config.css.extract = {
	filename: prefix + 'spa-app.css',
	chunkFilename: prefix + 'spa-vendors.css'
}
config.chainWebpack = config => {
	config.output.chunkFilename(prefix + 'spa-vendors.js')
	config.output.filename(prefix + 'spa-app.js')
}
config.configureWebpack.plugins = [
	new SentryWebpackPlugin({
		release: version,
		include: 'dist',
		ignoreFile: '.sentrycliignore',
		ignore: ['node_modules', 'webpack.config.js'],
		configFile: 'sentry.properties'
	})
]

and in my main.js I have

Sentry.init({
	dsn: 'my dsn',
	release: version,
	environment: process.env.VUE_APP_SENTRY_ENV,
	integrations: [new Sentry.Integrations.Vue({ 
		Vue,
		attachProps: true
	})]
})

#2

Can you link to the issues in your sentry.io account?

But generally explained we can not match the uploaded source maps with the event, that’s why you only see the minified code.
Reason for that could be that the release/dist in the event do not match with where you uploaded the source maps to with the plugin.

If you can’t paste link, can you at least post a screenshot of the artifact page of your release as well as a screenshot of the event detail page?


#3

ok so i just found out something

i’ve just generated another build with a new line that would generate an error
link to issue: https://sentry.io/organizations/euromatch/issues/924538904/?project=1405795&query=is%3Aunresolved&statsPeriod=14d&utc=false

the new line was on line 573 but it’s missing in the code preview… maybe the sourcemaps are not updating in sentry?


#4

Ok so I did a test.

I created a new release so the maps wont be cached or anything else

I built the dev build and uploaded to ftp AND sourcemaps to sentry

I built the live build and uploaded to ftp AND sourcemaps to sentry

Live files have a “live.” prefix so they are all different names

I generated errors on both envs and it worked ok

dev event: https://sentry.io/organizations/euromatch/issues/924523337/events/48813686911/?statsPeriod=14d&utc=false

live event: https://sentry.io/organizations/euromatch/issues/924523337/events/48813753611/?statsPeriod=14d&utc=false

Now, they both look ok. The problem I’m facing is that those files are both on a server

The actual live version is on another server. I’ve copied the live files (without sourcemaps because i’ve uploaded them to sentry), kept the same names and served them on the live server.

live event from the actual live server: issues/924727113/events/48813867521
sorry bot i cant post more than two links

this one shows a minified version