Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.9.2
Framework Version
Nuxt Version: 3.12.1
Link to Sentry event
No response
SDK Setup
- Operating System: Darwin
- Node Version: v20.12.2
- Nuxt Version: 3.12.1
- CLI Version: 3.12.0
- Nitro Version: 2.9.6
- Package Manager: yarn@1.22.19
- Builder: -
- User Config: -
- Runtime Modules: -
- Build Modules: -
// server/plugins/sentry.js
import { defineNitroPlugin } from 'nitropack/dist/runtime/plugin'
import * as Sentry from '@sentry/node'
import { useRuntimeConfig } from '#imports'
export default defineNitroPlugin(() => {
const { public: { sentry } } = useRuntimeConfig()
// If no sentry DSN set, ignore and warn in the console
if (!sentry.dsn) {
console.warn('Sentry DSN not set, skipping Sentry initialization')
}
// Initialize Sentry
Sentry.init({
dsn: sentry.dsn,
environment: sentry.environment,
})
})
Steps to Reproduce
Setup Nuxt project with server plugin
Run in dev mode (it works ok for build)
// server/plugins/sentry.js
import { defineNitroPlugin } from 'nitropack/dist/runtime/plugin'
import * as Sentry from '@sentry/node'
import { useRuntimeConfig } from '#imports'
export default defineNitroPlugin(() => {
const { public: { sentry } } = useRuntimeConfig()
// If no sentry DSN set, ignore and warn in the console
if (!sentry.dsn) {
console.warn('Sentry DSN not set, skipping Sentry initialization')
}
// Initialize Sentry
Sentry.init({
dsn: sentry.dsn,
environment: sentry.environment,
})
})
Expected Result
No error
Actual Result
ERROR [nuxt] [request error] [unhandled] [500] The requested module 'vue' does not provide an export named 'computed'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
at async ViteNodeRunner.interopedImport (./node_modules/vite-node/dist/client.mjs:384:28)
at async ViteNodeRunner.directRequest (./node_modules/vite-node/dist/client.mjs:253:24)
at async ViteNodeRunner.cachedRequest (./node_modules/vite-node/dist/client.mjs:189:14)
at async ViteNodeRunner.dependencyRequest (./node_modules/vite-node/dist/client.mjs:233:12)
at async ./virtual:nuxt:/Users/me/app-site/.nuxt/vue-router-stub.mjs:1:31
at async ViteNodeRunner.runModule (./node_modules/vite-node/dist/client.mjs:362:5)
at async ViteNodeRunner.directRequest (./node_modules/vite-node/dist/client.mjs:346:5) (repeated 2 times)
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.9.2
Framework Version
Nuxt Version: 3.12.1
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
Setup Nuxt project with server plugin
Run in dev mode (it works ok for build)
Expected Result
No error
Actual Result