Skip to content

Commit

Permalink
fix: fixes sentry errors on 404's pages (nodejs#6144)
Browse files Browse the repository at this point in the history
  • Loading branch information
ovflowd authored Nov 29, 2023
1 parent 21e27a6 commit ee7184b
Show file tree
Hide file tree
Showing 8 changed files with 18,553 additions and 18,600 deletions.
20 changes: 12 additions & 8 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,27 @@ const rootClasses = classNames(

const config: StorybookConfig = {
stories: ['../components/**/*.stories.tsx'],
addons: [
'@storybook/addon-controls',
'@storybook/addon-interactions',
'@storybook/addon-themes',
'@storybook/addon-viewport',
],
logLevel: 'error',
staticDirs: ['../public'],
typescript: { reactDocgen: false, check: false },
core: { disableTelemetry: true, disableWhatsNewNotifications: true },
framework: {
name: '@storybook/nextjs',
options: { builder: { useSWC: true } },
},
previewBody:
// This `<style>` is necessary to simulate what `next-themes` (ThemeProvider) does on real applications
// `next-theme` automatically injects the color-scheme based on the system preference or the current applied theme
// on Storybook we don't use `next-theme` as we want to simulate themes
'<style>:root { color-scheme: light; } html[data-theme="dark"] { color-scheme: dark; }</style>' +
// This adds the base styling for dark/light themes within Storybook. This is a Storybook-only style
`<body class="${rootClasses}"></body>`,
core: { disableTelemetry: true, disableWhatsNewNotifications: true },
framework: { name: '@storybook/nextjs', options: {} },
addons: [
'@storybook/addon-controls',
'@storybook/addon-interactions',
'@storybook/addon-themes',
'@storybook/addon-viewport',
],
webpack: async config => ({
...config,
// We want to conform as much as possible with our target settings
Expand Down
6 changes: 3 additions & 3 deletions app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Analytics } from '@vercel/analytics/react';
import { Source_Sans_3 } from 'next/font/google';
import { useLocale } from 'next-intl';
import { getLocale } from 'next-intl/server';
import type { FC, PropsWithChildren } from 'react';

import BaseLayout from '@/layouts/BaseLayout';
Expand All @@ -17,8 +17,8 @@ const sourceSans = Source_Sans_3({
subsets: ['latin'],
});

const RootLayout: FC<PropsWithChildren> = ({ children }) => {
const locale = useLocale();
const RootLayout: FC<PropsWithChildren> = async ({ children }) => {
const locale = await getLocale();

const { langDir, hrefLang } = availableLocalesMap[locale] || defaultLocale;

Expand Down
2 changes: 2 additions & 0 deletions app/[locale]/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { useTranslations } from 'next-intl';
import type { FC } from 'react';

Expand Down
2 changes: 0 additions & 2 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ const nextConfig = {
],
// Removes the warning regarding the WebPack Build Worker
webpackBuildWorker: false,
// Sentry Profiling Module should be treated as an external symbol
serverComponentsExternalPackages: ['@sentry/profiling-node'],
},
};

Expand Down
Loading

0 comments on commit ee7184b

Please sign in to comment.