Skip to content

Commit

Permalink
fix(nextjs): Add selfhosted url in next.config.js (#438)
Browse files Browse the repository at this point in the history
adds the previously missing url paramter to the template if users are using self-hosted sentry

Co-authored-by: Lukas Stracke <[email protected]>
  • Loading branch information
andreysam and Lms24 authored Sep 13, 2023
1 parent dbc332b commit 8dedd81
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
## Unreleased

- enh(android): Show link to issues page after setup is complete (#448)

- fix(nextjs): Add selfhosted url in `next.config.js` (#438)

## 3.12.0

- feat(sourcemaps): Automatically insert Sentry Webpack plugin (#432)
Expand Down
2 changes: 2 additions & 0 deletions src/nextjs/nextjs-wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ export async function runNextjsWizard(options: WizardOptions): Promise<void> {
const sentryWebpackOptionsTemplate = getNextjsWebpackPluginOptionsTemplate(
selectedProject.organization.slug,
selectedProject.slug,
selfHosted,
sentryUrl,
);
const sentryBuildOptionsTemplate = getNextjsSentryBuildOptionsTemplate();

Expand Down
5 changes: 3 additions & 2 deletions src/nextjs/templates.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
export function getNextjsWebpackPluginOptionsTemplate(
orgSlug: string,
projectSlug: string,
selfHosted: boolean,
url: string,
): string {
return `{
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options
// Suppresses source map uploading logs during build
silent: true,
org: "${orgSlug}",
project: "${projectSlug}",
project: "${projectSlug}",${selfHosted ? `\n url: "${url}"` : ''}
}`;
}

Expand Down

0 comments on commit 8dedd81

Please sign in to comment.