Мы развертываем в Vercel и загружаем исходные карты в Sentry, сгенерированные исходные карты успешно загружаются, но нам не хватает большого количества исходных карт.
Вот пример результатов из журналов сборки Vercel;
Код: Выделить всё
@company/project:build: \~/0f19a506e2f8f51b.js (no sourcemap found)
@company/project:build: - warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for \~/0f19a506e2f8f51b.js)
@company/project:build: \~/0f52eebdadff9e11.js (no sourcemap found)
@company/project:build: - warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for \~/0f52eebdadff9e11.js)
@company/project:build: \~/0f890dcc8f56cc0a.js (no sourcemap found, debug id 75d86540-2e61-5f66-7231-a00fedc9db28)
...
@company/project:build: - warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for \~/turbopack-9b547cc17f45ef74.js)
@company/project:build: \~/turbopack-b1167f93224968d4.js (no sourcemap found, debug id 6d5c4cd8-ed5c-9a8d-6b57-65e5b46ae2ee)
Код: Выделить всё
~/blah.jsЯ не знаю, как лучше всего отладить эти файлы, не имеющие связанных с ними исходных карт, мы будем очень признательны за любые общие рекомендации, а если возникнут конкретные проблемы с приведенными ниже конфигурациями, мы будем рады их исправить.
Настройка
- Monorepo с использованием Turborepo (2.6.3)
- NextJS 16.0.10
- Typescript 5.8.3
- Sentry/nextjs 9.40
Код: Выделить всё
{
"extends": "@company/tsconfig/base.json",
"include": \["next-env.d.ts", "**/\*.ts", "**/*.tsx", ".next/types/\*\*/*.ts"\],
"exclude": \["node_modules", ".next/types/validator.ts"\],
"compilerOptions": {
"sourceMap": true,
"outDir": "dist",
"baseUrl": ".",
"paths": { "variables": \["utils/variables.ts"\] },
"moduleResolution": "bundler",
"target": "ES2015",
"lib": \["dom", "dom.iterable", "esnext"\],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"typeRoots": \["../../node_modules/@types", "./types"\],
"plugins": \[
{ "name": "next", "enabled": true },
{
"name": "@styled/typescript-styled-plugin",
"lint": {
"validProperties": \["container-type"\],
"unknownAtRules": "ignore"
}
}\]
}
Код: Выделить всё
const SentryWebpackPluginOptions = {
org: "...",
project: "...",
authToken: process.env.SENTRY_AUTH_TOKEN,
silent: !process.env.CI,
widenClientFileUpload: true,
reactComponentAnnotation: { enabled: true },
tunnelRoute: "/sentry-monitoring",
disableLogger: true,
automaticVercelMonitors: true,
};
Код: Выделить всё
const nextConfig = {
reactCompiler: true,
turbopack: {
root: path.join(\__dirname, "../.."),
debugIds: true,
},
compiler: { styledComponents: true },
serverExternalPackages: \["css-tree"\],
experimental: {
esmExternals: true,
swcPlugins: \[\["superjson-next", { router: "APP" }\]\],
serverActions: { allowedOrigins: \[...\] },
optimizePackageImports: \["@mantine/core", "@mantine/hooks"\],
turbopackFileSystemCacheForDev: true,
},
basePath,
productionBrowserSourceMaps: false,
staticPageGenerationTimeout: 100,
...
}
Подробнее здесь: https://stackoverflow.com/questions/798 ... orepo-usin