Skip to content

feat(nuxt): Add nuxt example #37

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

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/nuxt/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<header>
<nav>
<ul>
<li><NuxtLink to="/test-param/1234">About</NuxtLink></li>
<li><NuxtLink to="/catchAll/my-id-1337">Post 1</NuxtLink></li>
<li><NuxtLink to="/test-param/1234">Test Param</NuxtLink></li>
<li><NuxtLink to="/catchAll/my-id-1337">Catch All Route</NuxtLink></li>
<li><NuxtLink to="/404">404</NuxtLink></li>
<li><NuxtLink to="/?middleware">Faulty Router Middleware</NuxtLink></li>
</ul>
Expand Down
14 changes: 2 additions & 12 deletions apps/nuxt/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
import * as Sentry from '@sentry/nuxt';

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true },
modules: ['@sentry/nuxt'],

runtimeConfig: {
public: {
sentry: {
dsn: '' /* DSN */,
debug: true,
},
},
},
modules: ['@sentry/nuxt/module'],
debug: false,
});
3 changes: 2 additions & 1 deletion apps/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
"postinstall": "nuxt prepare",
"clean": "npx nuxi cleanup"
},
"dependencies": {
"@sentry/nuxt": "file:.yalc/@sentry/nuxt",
Expand Down
8 changes: 8 additions & 0 deletions apps/nuxt/sentry.client.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as Sentry from '@sentry/nuxt';

Sentry.init({
dsn: 'your-dsn',
debug: true,
tracesSampleRate: 1,
integrations: [Sentry.browserTracingIntegration()],
});
7 changes: 7 additions & 0 deletions apps/nuxt/sentry.server.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as Sentry from '@sentry/nuxt';

Sentry.init({
dsn: process.env.SENTRY_DSN,
tracesSampleRate: 1,
debug: true,
});
Loading