sentry-module: delayedCalls is undefined when using lazy: true
Version
@nuxtjs/sentry: 5.1.3 nuxt: 2.15.8
Sentry configuration
sentry: {
disabled: process.env.APP_ERROR_REPORTING_ENABLED === 'false',
lazy: true,
publishRelease: false,
config: {
environment: process.env.VUE_APP_ENVIRONMENT || 'production',
release: appVersion
}
},
Steps to reproduce
Enable lazy mode
What is Expected?
No errors
What is actually happening?
Occasionally I get this error:

Ignore the LogRocket mentions, it’s just capturing it.

I traced it back to this line: https://github.com/nuxt-community/sentry-module/blob/master/lib/plugin.lazy.js#L48
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (9 by maintainers)
I can’t actually reproduce locally but looking at your minified code:
this is indeed the reason. It’s quite aggressively minified compared to mine:
You can see that in my case the
app.$sentryis not cached into a local variable so everything works. In your case the minified code does something likevar r = app.$sentryearlier so it holds to mocked$sentryreference and uses it even afterapp.$sentrywas updated.Have you modified any of the babel or terser settings in your nuxt config?