getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.98k stars 1.57k forks source link

Missing possibility to overwrite all nextjs keys to blitzjs in @sentry/nextjs #3706

Closed prisis closed 3 years ago

prisis commented 3 years ago

Package + Version

Version:

6.7.1

Description

Would i be possible to get a possibility to overwrite all .next keys with a option to .blitz?

flybayer commented 3 years ago

Fyi, we are changing some blitz internals, so likely this will just work as expected

prisis commented 3 years ago

Then this is not needed anymore?

const SentryWebpackPluginOptions = {
    include: ".blitz/",
    urlPrefix: "~/_blitz",
    // Additional config options for the Sentry Webpack plugin. Keep in mind that
    // the following options are set automatically, and overriding them is not
    // recommended:
    //   release, url, org, project, authToken, configFile, stripPrefix,
    //   urlPrefix, include, ignore
    // For all available options, see:
    // https://github.com/getsentry/sentry-webpack-plugin#options.
};

and in sentry.server.config.js


// This file configures the initialization of Sentry on the server.
// The config you add here will be used whenever the server handles a request.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from "@sentry/nextjs";
import getConfig from "next/config";
import { RewriteFrames } from "@sentry/integrations";
import serverEnvironment from "./config/server-environment";

const SENTRY_DSN = serverEnvironment.NEXT_PUBLIC_SENTRY_DSN;

const config = getConfig();
const distDir = `${config.serverRuntimeConfig.rootDir}/.blitz`;

Sentry.init({
    dsn: SENTRY_DSN,
....
flybayer commented 3 years ago

Yeah my goal is that it should would exactly the same as with next without additional config.

lobsterkatie commented 3 years ago

@flybayer - Any update on this from your end?

flybayer commented 3 years ago

@lobsterkatie we're progressing on our nextjs fork migration which is the blocker here I think. Making progress but not finished yet.

lobsterkatie commented 3 years ago

Great, thanks. Let us know!

prisis commented 3 years ago

With the latest v0.40 releases this should be fixed, correct me if im wrong @flybayer

flybayer commented 3 years ago

@prisis yes, 0.40 releases no longer use .blitz, only using .next. So please test and report back.

That said, there is also a possibility we'll change .next default to .blitz before 1.0.

prisis commented 3 years ago

Tested and it looks good, for my use cases