getsentry / sentry-wizard

Sentry Project Setup Wizard
MIT License
193 stars 48 forks source link

[bug] Wizard is asking to select package manager twice #689

Closed gokaygurcan closed 3 weeks ago

gokaygurcan commented 3 weeks ago

Environment

v3.34.1

Steps to Reproduce

  1. Ran bunx --bun @sentry/wizard@latest -i nextjs
  2. Was asked to select my package manager twice during the process.

Expected Result

Should ask it once, I guess.

Actual Result

Here's the full output:

bunx --bun @sentry/wizard@latest -i nextjs                                                                                                                                       git:(dev|⚑7) 
Resolving dependencies
Resolved, downloaded and extracted [344]
Saved lockfile

┌   Sentry Next.js Wizard 
│
◇   ────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                   │
│  The Sentry Next.js Wizard will help you set up Sentry for your application.                      │
│  Thank you for using Sentry :)                                                                    │
│                                                                                                   │
│  Version: 3.34.1                                                                                  │
│                                                                                                   │
│  This wizard sends telemetry data and crash reports to Sentry. This helps us improve the Wizard.  │
│  You can turn this off at any time by running sentry-wizard --disable-telemetry.                  │
│                                                                                                   │
├───────────────────────────────────────────────────────────────────────────────────────────────────╯
│
◇  Are you using Sentry SaaS or self-hosted Sentry?
│  Sentry SaaS (sentry.io)
│
◇  Do you already have a Sentry account?
│  Yes
│
●  If the browser window didn't open automatically, please open the following link to log into Sentry:
│  
│  https://sentry.io/account/settings/wizard/__REDACTED__/
│
◇  Login complete.
│
◇  Selected project gokaygurcan/__REDACTED__
│
◇  Please select your package manager.                           <--- HERE'S THE FIRST QUESTION
│  Bun
│
◇  Installed @sentry/nextjs@^8 with Bun.
│
◇  Do you want to route Sentry requests in the browser through your Next.js server to avoid ad blockers?
│  Yes
│
◇  Do you want to enable React component annotations to make breadcrumbs and session replays more readable?
│  Yes
│
◇  Do you want to enable Tracing to track the performance of your application?
│  Yes
│
◇  Do you want to enable Sentry Session Replay to get a video-like reproduction of errors during a user session?
│  Yes
│
◆  Created fresh sentry.server.config.ts.
│
◆  Created fresh sentry.client.config.ts.
│
◆  Created fresh sentry.edge.config.ts.
│
◇  Add the following code to your instrumentation.ts file:

import * as Sentry from '@sentry/nextjs';

export async function register() {
  if (process.env.NEXT_RUNTIME === 'nodejs') {
    await import('../sentry.server.config');
  }

  if (process.env.NEXT_RUNTIME === 'edge') {
    await import('../sentry.edge.config');
  }
}

export const onRequestError = Sentry.captureRequestError;

│
◇  Did you apply the snippet above?
│  Yes, continue!
│
◆  Added Sentry configuration to next.config.js. (you probably want to clean this up a bit!)
│
●  It seems like you already have a custom error page for your app directory.
│  
│  Please add the following code to your custom error page
│  at src/app/global-error.tsx:
│  
"use client";

import * as Sentry from "@sentry/nextjs";
import Error from "next/error";
import { useEffect } from "react";

export default function GlobalError({ error }: { error: Error }) {
  useEffect(() => {
    Sentry.captureException(error);
  }, [error]);

  return (
    <html>
      <body>
        {/* Your Error component here... */}
      </body>
    </html>
  );
}

│
◇  Did add the code to your src/app/global-error.tsx file as described above?
│  Yes
│
◇  Do you want to create an example page ("/sentry-example-page") to test your Sentry setup?
│  No
│
◆  Created .env.sentry-build-plugin with auth token for you to test source map uploading locally.
│
■  Failed adding .env.sentry-build-plugin to .gitignore. Please add it manually!
│
◇  Are you using a CI/CD tool to build and deploy your application?
│  Yes
│
◇  Add the Sentry authentication token as an environment variable to your CI setup:

SENTRY_AUTH_TOKEN=sntrys___REDACTED__

│
▲  DO NOT commit this auth token to your repository!
│
◇  Did you configure CI as shown above?
│  Yes, continue!
│
◇  Please select your package manager.                           <--- HERE'S THE SECOND QUESTION
│  Bun
│
└  
Successfully installed the Sentry Next.js SDK! 

If you encounter any issues, let us know here: https://github.com/getsentry/sentry-javascript/issues
Lms24 commented 3 weeks ago

Hi @gokaygurcan thanks for reporting! I think I just introduced this in #687 😬

I'll open a PR to fix this in a minute and then make another release. The good news: You made it almost through the wizard. You're not missing anything in your setup, so you should be good to go :)

Lms24 commented 3 weeks ago

well looks like @lforst was faster than me 😅 anyway, this will be fixed soon

gokaygurcan commented 3 weeks ago

Thanks a lot. It's not a deal breaker anyway. But would be nice to get rid of the second question at some point for the sake of simplicity.

Cheers

lforst commented 3 weeks ago

fixed and shipped. Thanks for reporting!