Skip to content
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
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@

NEXT_PUBLIC_ALGOLIA_APP_ID=
NEXT_PUBLIC_ALGOLIA_SEARCH_KEY=
NEXT_PUBLIC_SENTRY_DSN=
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ typings/
# Output of 'npm pack'
*.tgz

# dotenv environment variables file
# dotenv environment variables files
.env
.env.development
.env.*
!.env.example

# gatsby files
.cache/
Expand Down
9 changes: 3 additions & 6 deletions next.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {codecovNextJSWebpackPlugin} from '@codecov/nextjs-webpack-plugin';
import {withSentryConfig} from '@sentry/nextjs';

import {redirects} from './redirects.js';
import {REMOTE_IMAGE_PATTERNS} from './src/config/images';
import {redirects} from './redirects.js';

const outputFileTracingExcludes = process.env.NEXT_PUBLIC_DEVELOPER_DOCS
? {
Expand Down Expand Up @@ -40,12 +40,9 @@ const outputFileTracingExcludes = process.env.NEXT_PUBLIC_DEVELOPER_DOCS
],
};

if (
process.env.NODE_ENV !== 'development' &&
(!process.env.NEXT_PUBLIC_SENTRY_DSN || !process.env.SENTRY_DSN)
) {
if (process.env.NODE_ENV !== 'development' && !process.env.NEXT_PUBLIC_SENTRY_DSN) {
throw new Error(
'Missing required environment variables: NEXT_PUBLIC_SENTRY_DSN and SENTRY_DSN must be set in production'
'Missing required environment variable: NEXT_PUBLIC_SENTRY_DSN must be set in production'
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default defineNuxtConfig({
runtimeConfig: {
public: {
sentry: {
dsn: process.env.SENTRY_DSN_PUBLIC, // Use a public environment variable for the DSN
dsn: process.env.NUXT_PUBLIC_SENTRY_DSN, // Use a public environment variable for the DSN
},
},
},
Expand Down
3 changes: 2 additions & 1 deletion src/hotReloadWatcher.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import path from 'path';

import {watch} from 'node:fs/promises';
import {WebSocketServer} from 'ws';

Expand All @@ -9,7 +10,7 @@ export const throttle = (fn, delay) => {
return (...args) => {
const now = Date.now();
if (now - last < delay) {
return;
return undefined;
}
last = now;
return fn(...args);
Expand Down
4 changes: 2 additions & 2 deletions src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as Sentry from '@sentry/nextjs';
export function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
Sentry.init({
dsn: process.env.SENTRY_DSN,
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: 1,
enableLogs: true,
debug: false,
Expand All @@ -15,7 +15,7 @@ export function register() {

if (process.env.NEXT_RUNTIME === 'edge') {
Sentry.init({
dsn: process.env.SENTRY_DSN,
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: 1,
enableLogs: true,
debug: false,
Expand Down
Loading