Error during runtime when integrating Sentry with Vue2+Webpack #12655
Unanswered
gsol-bretttang
asked this question in
Q&A
Replies: 1 comment
-
@gsol-bretttang please open a bug report: https://github.com/getsentry/sentry-javascript/issues/new?assignees=&labels=Type%3A+Bug&projects=&template=bug.yml |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I integrated Sentry according to the official documentation, but encountered an error during runtime
Error:
Module parse failed: Unexpected token (17:4)
You may need an appropriate loader to handle this file type.
|
| const integration = browserTracingIntegration$1({
| ...options,
| instrumentNavigation: false,
| });
@ ./node_modules/@sentry/vue/esm/index.js 3:0-75
@ ./src/plugins/sentry/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://0.0.0.0:8001 webpack/hot/dev-server babel-polyfill ./src/main.js
error in ./node_modules/@sentry/vue/node_modules/@sentry/core/esm/eventProcessors.js
Module parse failed: Unexpected token (18:33)
You may need an appropriate loader to handle this file type.
| resolve(event);
| } else {
| const result = processor({ ...event }, hint) ;
|
| DEBUG_BUILD && processor.id && result === null && logger.log(
Event processor "${processor.id}" dropped event
);@ ./node_modules/@sentry/vue/node_modules/@sentry/core/esm/index.js 23:0-61
@ ./node_modules/@sentry/vue/esm/errorhandler.js
@ ./node_modules/@sentry/vue/esm/index.js
@ ./src/plugins/sentry/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://0.0.0.0:8001 webpack/hot/dev-server babel-polyfill ./src/main.js
I tried to change the babel loader configuration in webpack.baseconfig.js and resolved the issue
{
test: /.js$/,
loader: 'babel-loader',
include: [
resolve('src'),
resolve('test'),
resolve('node_modules/webpack-dev-server/client'),
resolve('node_modules/@sentry'),
]
},
But this increased the duration of my NPM run build by 3 minutes, and there is a certain probability of build failure.
error building image: error building stage: failed to execute command: waiting for process to exit: exit status 1
May I ask if any brothers have encountered this problem?
Thank you for your answer.
Beta Was this translation helpful? Give feedback.
All reactions