-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if i use vue2 with vite, can this plugin work? #4
Comments
Hi @weirui88888 ! |
I am frustrated, everything is configured according to the documentation。but it seems that the located source file is always wrong。:tired_face: |
Can you please provide some context? What you already did, maybe part of configs? There are multiple situations when sentry will not load/use source maps, for example when the app is not in public url (you can use ngrok/localtunnel in that situations), or there can be wrong |
thanks! i think my config of Below is my configuration:import { defineConfig } from "vite"
import vue from "@vitejs/plugin-vue"
import viteSentry from "vite-plugin-sentry"
import legacy from "@vitejs/plugin-legacy"
import { minifyHtml } from "vite-plugin-html"
import builtins from "rollup-plugin-node-builtins"
const builtinsPlugin = { ...builtins({ crypto: true }), name: "rollup-plugin-node-builtins" }
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
builtinsPlugin,
vue(),
legacy({
targets: ["defaults", "iOS >= 10"]
}),
minifyHtml(),
viteSentry({
debug: true,
url: "xxx",
authToken: "xxx",
org: "xxx",
project: "xxx",
deploy: {
env: "production"
},
setCommits: {
auto: false
},
release: "v0.0.3",
sourceMaps: {
include: ["./dist/assets"],
ignore: ["node_modules"],
urlPrefix: "~/assets"
}
})
],
define: {
"process.env": process.env
},
build: {
target: "es2015",
cssTarget: "chrome61",
chunkSizeWarningLimit: 1555,
sourcemap: true,
minify: false
}
}) Too tired, tossing for a few days 😟 |
Hmmm, config seems to be correct 🤔 Make sure to pass same release/environment settings in I've used this permissions setup: Here is config i've used for vue2 test setup (you can also try to set {
// ...
plugins: [
createVuePlugin(),
vitePluginSentry({
authToken: 'x',
org: 'x',
project: 'vue',
release: version, // from package.json
deploy: {
env: "production"
},
setCommits: {
auto: true,
ignoreEmpty: true
},
sourceMaps: {
// dist: 'prod', // you can try to set this option to add tag to sourcemaps, and set the same option in .init
sourceMapReference: true,
ext: ['map', 'js'],
include: ['./dist/assets'],
ignore: ['node_modules'],
urlPrefix: '~/assets/'
}
})
]
} And here's client sdk setup: import Vue from 'vue'
import * as Sentry from "@sentry/vue"
import { version } from '../package.json'
Sentry.init({
Vue,
release: version,
environment: 'production',
dsn: "x",
// dist: 'prod', <-- sourcemaps tag
}); Also, please check this issue, maybe your problem is related |
Oh and i totally forgot - try to upgrade to latest version, i've sent updates to npm about 3hrs ago. Latest plugin version contains updated @sentry/cli package! 👍 |
I will try one by one ,Thank you so much for your help。 When I succeed, I will be the first to notify you。:smile: |
Still there? In order to maintain a similar configuration with you, I created a demo project with vite, which uses vue2. Why can't I locate it accurately? I'll find a way for you to try to see my demo. 👊 |
@weirui88888 yeah, this |
below is my demo,please clone it,and config sentry as youselfhi friend,I wrote a simple demo. Can you clone it down and help me see it? Remember to configure your own sentry config. Thank you very much。 |
Hmm, just tested it with your settings and seems it just fine. Here all my diffs from original config: On sentry sourcemaps artifacts all the needed files: And here is error output: The only problem which i see - there is no sourcemap files for Also, i see that you use |
Yeah, i see now. I thought you had problem with uploading source maps. Unfortunately, after some investigation, i can't say why sourcemaps for vue was generated that in that way 😔 It does'nt looks like a plugin bug, because it just upload ready to use sourcemap files and nothing else. I think problem is hidden somewhere deeper. Seems that generated sourcemaps missing all the Vue single component logic tags (script,template,style) and because of that we getting wrong error positions in sentry output. |
Maybe we can find the answer here. It seems to be a plug-in problem in vite-plugin-vue2 |
No description provided.
The text was updated successfully, but these errors were encountered: