Comments (6)
Hi @foodiecompany could you share your next.config.js
file?
The issue here is probably sourcemaps generation (which is handled by nextjs, sentry just is responsible for uploading). What version of next.js/webpack are you using?
from sentry-javascript.
Sure
const { withSentryConfig } = require("@sentry/nextjs");
const path = require("path");
const env = process.env;
const SENTRY_PROJECT_NAME = env.SENTRY_PROJECT_NAME;
const IS_PRODUCTION = env.NODE_ENV === "production";
const STRAPI_MEDIA_HOST = IS_PRODUCTION ? "res.cloudinary.com" : "127.0.0.1";
let config = {
reactStrictMode: true,
output: "standalone",
transpilePackages: [
"ui",
"@ant-design",
"antd",
"rc-pagination",
"rc-picker",
"rc-util"
],
images: {
remotePatterns: [
{
protocol: IS_PRODUCTION ? "https" : "http",
hostname: STRAPI_MEDIA_HOST
}
]
},
experimental: {
outputFileTracingRoot: path.join(__dirname, "../../"),
optimizePackageImports: ["lodash", "@ant-design", "antd"],
// The instrumentation hook is required for Sentry to work on the serverside
instrumentationHook: true
}
};
// Injected content via Sentry wizard below
if (SENTRY_PROJECT_NAME) {
config = withSentryConfig(config, {
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options
org: "fastybill-vr",
project: SENTRY_PROJECT_NAME,
// Only print logs for uploading source maps in CI
silent: true,
// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,
// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: true,
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
// This can increase your server load as well as your hosting bill.
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
tunnelRoute: "/monitoring",
// Hides source maps from generated client bundles
hideSourceMaps: true,
// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
// Enables automatic instrumentation of Vercel Cron Monitors.
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true
});
}
module.exports = config;
Dockerfile
FROM node:18-alpine AS base
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev vips-dev git > /dev/null 2>&1
FROM base AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk update
RUN apk add --no-cache libc6-compat
# Set working directory
WORKDIR /app
RUN yarn global add turbo
COPY . .
RUN turbo prune staff --docker
# Add lockfile and package.json's of isolated subworkspace
FROM base AS installer
RUN apk update
RUN apk add --no-cache libc6-compat
WORKDIR /app
# First install the dependencies (as they change less often)
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/package-lock.json ./package-lock.json
RUN npm install -g node-gyp
RUN npm i sharp
RUN npm install
# Build the project
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json
# The SENTRY env are send when we deployed the docker image
ARG SENTRY_PROJECT_NAME
ENV SENTRY_PROJECT_NAME=${SENTRY_PROJECT_NAME}
ARG SENTRY_AUTH_TOKEN
ENV SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN}
ARG SENTRY_DSN
ENV SENTRY_DSN=${SENTRY_DSN}
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
RUN npm run build:staff
FROM base AS runner
WORKDIR /app
# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs
COPY --from=builder /app/apps/staff/next.config.js .
COPY --from=installer /app/apps/staff/package.json .
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=installer --chown=nextjs:nodejs /app/apps/staff/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/staff/.next/static ./apps/staff/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/staff/public ./apps/staff/public
# Expose ports (for orchestrators and dynamic reverse proxies)
EXPOSE 3001
ENV PORT=3001
ENV HOSTNAME="0.0.0.0"
# Run the nextjs app
CMD ["node", "apps/staff/server.js"]
from sentry-javascript.
Can you try this workaround? #10468 (comment)
from sentry-javascript.
Related Issues (20)
- Add solidstart to release registry
- Add release registry target entry for solidstart to craft.yml
- Add solidstart SDK docs
- Add solidstart onboarding
- A drop in simultaneous requests per seconds with Bun when Sentry is active HOT 3
- Align `Span` interface with changes in Otel Span interface
- Could not find a declaration file for module `@sentry/profiling-node` HOT 5
- Sentry SDK sends events of type `session` twice to two different DSNs
- Add Nuxt SDK package boilerplate
- Inconsisten span origin naming
- SpyOn captureException no longer works in sentry/react 8 HOT 2
- V8 Integrations are broken HOT 9
- Code sign the Sentry lambda layer to use in code signed lambdas HOT 1
- Module not found: Can't resolve 'opentelemetry-instrumentation-fetch-node' HOT 3
- Local variables missing when exception originates in node_modules dependency HOT 4
- Renable http instrumentation test for node-express-esm-preload
- Feedback Modal: Missing Screenshot btn in production HOT 3
- Sentry.captureFeedback produces unviewable images in sentry.io
- Problems with `@sentry/astro` on Netlify HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentry-javascript.