diff --git a/apps/builder/next.config.js b/apps/builder/next.config.js index 8d05f4cc72..14a5e3ce38 100644 --- a/apps/builder/next.config.js +++ b/apps/builder/next.config.js @@ -31,6 +31,7 @@ const nextConfig = withTM({ const sentryWebpackPluginOptions = { silent: true, + release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA + '-builder', } module.exports = process.env.NEXT_PUBLIC_SENTRY_DSN diff --git a/apps/builder/package.json b/apps/builder/package.json index 118a5daf05..bd63f19373 100644 --- a/apps/builder/package.json +++ b/apps/builder/package.json @@ -35,7 +35,7 @@ "@giphy/react-components": "6.5.2", "@googleapis/drive": "4.0.1", "@lezer/css": "^1.1.1", - "@sentry/nextjs": "7.34.0", + "@sentry/nextjs": "7.36.0", "@stripe/stripe-js": "1.46.0", "@tanstack/react-query": "^4.23.0", "@tanstack/react-table": "8.7.8", diff --git a/apps/builder/sentry.client.config.js b/apps/builder/sentry.client.config.js index 82d1f79e8f..39292b70f4 100644 --- a/apps/builder/sentry.client.config.js +++ b/apps/builder/sentry.client.config.js @@ -1,23 +1,14 @@ -// This file configures the initialization of Sentry on the browser. -// The config you add here will be used whenever a page is visited. -// https://docs.sentry.io/platforms/javascript/guides/nextjs/ - import * as Sentry from '@sentry/nextjs' +const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN + Sentry.init({ - dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, + dsn: SENTRY_DSN, ignoreErrors: ['ResizeObserver loop limit exceeded'], - release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA, - beforeBreadcrumb(breadcrumb, hint) { - try { - if (breadcrumb.category?.startsWith('ui')) { - breadcrumb.message = `${hint?.event.target.tagName.toLowerCase()}: ${ - hint?.event.target.innerText - }` - } - } catch (e) { - /* empty */ - } - return breadcrumb + debug: true, + beforeSend: (event) => { + console.log('[SENTRY] beforeSend event:', event) + return event }, + release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA + '-builder', }) diff --git a/apps/builder/sentry.server.config.js b/apps/builder/sentry.server.config.js index 87c036bf33..c7e31494cf 100644 --- a/apps/builder/sentry.server.config.js +++ b/apps/builder/sentry.server.config.js @@ -1,11 +1,8 @@ -// This file configures the initialization of Sentry on the browser. -// The config you add here will be used whenever a page is visited. -// https://docs.sentry.io/platforms/javascript/guides/nextjs/ - import * as Sentry from '@sentry/nextjs' +const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN + Sentry.init({ - dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, - ignoreErrors: ['ResizeObserver loop limit exceeded'], - release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA, + dsn: SENTRY_DSN, + release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA + '-builder', }) diff --git a/apps/builder/src/features/graph/components/Nodes/ItemNode/ItemNode.tsx b/apps/builder/src/features/graph/components/Nodes/ItemNode/ItemNode.tsx index 75dcf9fd6e..c046601901 100644 --- a/apps/builder/src/features/graph/components/Nodes/ItemNode/ItemNode.tsx +++ b/apps/builder/src/features/graph/components/Nodes/ItemNode/ItemNode.tsx @@ -13,6 +13,7 @@ import { ItemNodeContent } from './ItemNodeContent' import { ItemNodeContextMenu } from './ItemNodeContextMenu' import { ContextMenu } from '@/components/ContextMenu' import { setMultipleRefs } from '@/utils/helpers' +import { isDefined } from 'utils' type Props = { item: Item @@ -39,11 +40,12 @@ export const ItemNode = ({ const itemRef = useRef(null) const isPreviewing = previewingEdge?.from.itemId === item.id const isConnectable = + isDefined(typebot) && !connectionDisabled && !( - typebot?.groups[indices.groupIndex].blocks[ - indices.blockIndex - ] as ChoiceInputBlock + typebot.groups[indices.groupIndex].blocks[indices.blockIndex] as + | ChoiceInputBlock + | undefined )?.options?.isMultipleChoice const onDrag = (position: NodePosition) => { if (!onMouseDown) return diff --git a/apps/builder/src/features/graph/components/Nodes/ItemNode/ItemNodesList.tsx b/apps/builder/src/features/graph/components/Nodes/ItemNode/ItemNodesList.tsx index aac27e20ed..73aebe39d5 100644 --- a/apps/builder/src/features/graph/components/Nodes/ItemNode/ItemNodesList.tsx +++ b/apps/builder/src/features/graph/components/Nodes/ItemNode/ItemNodesList.tsx @@ -26,6 +26,7 @@ import React, { useEffect, useRef, useState } from 'react' import { ItemNode } from './ItemNode' import { SourceEndpoint } from '../../Endpoints' import { PlaceholderNode } from '../PlaceholderNode' +import { isDefined } from 'utils' type Props = { block: BlockWithItems @@ -46,7 +47,8 @@ export const ItemNodesList = ({ draggedItem !== undefined && block.items[0].type === draggedItem.type const isLastBlock = - typebot?.groups[groupIndex].blocks[blockIndex + 1] === undefined + isDefined(typebot) && + typebot.groups[groupIndex].blocks[blockIndex + 1] === undefined const [position, setPosition] = useState({ x: 0, diff --git a/apps/viewer/next.config.js b/apps/viewer/next.config.js index 262a91d41b..416026460a 100644 --- a/apps/viewer/next.config.js +++ b/apps/viewer/next.config.js @@ -18,6 +18,7 @@ const nextConfig = withTM({ const sentryWebpackPluginOptions = { silent: true, + release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA + '-viewer', } module.exports = process.env.NEXT_PUBLIC_SENTRY_DSN diff --git a/apps/viewer/package.json b/apps/viewer/package.json index 33206eab00..38a305881f 100644 --- a/apps/viewer/package.json +++ b/apps/viewer/package.json @@ -13,7 +13,7 @@ "test:report": "pnpm playwright show-report" }, "dependencies": { - "@sentry/nextjs": "7.34.0", + "@sentry/nextjs": "7.36.0", "@trpc/server": "10.9.0", "@typebot.io/js": "workspace:*", "@typebot.io/react": "workspace:*", diff --git a/apps/viewer/sentry.client.config.js b/apps/viewer/sentry.client.config.js index 9496473a8b..65de85daea 100644 --- a/apps/viewer/sentry.client.config.js +++ b/apps/viewer/sentry.client.config.js @@ -4,13 +4,15 @@ import * as Sentry from '@sentry/nextjs' +const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN + Sentry.init({ - dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, + dsn: SENTRY_DSN, ignoreErrors: [ 'ResizeObserver loop limit exceeded', 'ResizeObserver loop completed with undelivered notifications.', 'ResizeObserver is not defined', "Can't find variable: ResizeObserver", ], - release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA, + release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA + '-viewer', }) diff --git a/apps/viewer/sentry.server.config.js b/apps/viewer/sentry.server.config.js index 6b61114e33..0b32945397 100644 --- a/apps/viewer/sentry.server.config.js +++ b/apps/viewer/sentry.server.config.js @@ -4,13 +4,9 @@ import * as Sentry from '@sentry/nextjs' +const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN + Sentry.init({ - dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, - ignoreErrors: [ - 'ResizeObserver loop limit exceeded', - 'ResizeObserver loop completed with undelivered notifications.', - 'ResizeObserver is not defined', - "Can't find variable: ResizeObserver", - ], - release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA, + dsn: SENTRY_DSN, + release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA + '-viewer', }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 706ea1e1d3..9487dd5a8e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -41,7 +41,7 @@ importers: '@googleapis/drive': 4.0.1 '@lezer/css': ^1.1.1 '@playwright/test': 1.30.0 - '@sentry/nextjs': 7.34.0 + '@sentry/nextjs': 7.36.0 '@stripe/stripe-js': 1.46.0 '@tanstack/react-query': ^4.23.0 '@tanstack/react-table': 8.7.8 @@ -149,7 +149,7 @@ importers: '@giphy/react-components': 6.5.2_57czaiyk6rdr5iy5tfs5pior4u '@googleapis/drive': 4.0.1 '@lezer/css': 1.1.1 - '@sentry/nextjs': 7.34.0_next@13.1.6+react@18.2.0 + '@sentry/nextjs': 7.36.0_next@13.1.6+react@18.2.0 '@stripe/stripe-js': 1.46.0 '@tanstack/react-query': 4.24.4_biqbaboplfbrettd7655fr4n2y '@tanstack/react-table': 8.7.8_biqbaboplfbrettd7655fr4n2y @@ -354,7 +354,7 @@ importers: '@babel/preset-env': 7.20.2 '@faire/mjml-react': 3.1.0 '@playwright/test': 1.30.0 - '@sentry/nextjs': 7.34.0 + '@sentry/nextjs': 7.36.0 '@trpc/server': 10.9.0 '@typebot.io/js': workspace:* '@typebot.io/react': workspace:* @@ -397,7 +397,7 @@ importers: utils: workspace:* zod: 3.20.2 dependencies: - '@sentry/nextjs': 7.34.0_next@13.1.6+react@18.2.0 + '@sentry/nextjs': 7.36.0_next@13.1.6+react@18.2.0 '@trpc/server': 10.9.0 '@typebot.io/js': link:../../packages/js '@typebot.io/react': link:../../packages/react @@ -5987,14 +5987,14 @@ packages: resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==} dev: false - /@sentry/browser/7.34.0: - resolution: {integrity: sha512-5Jmjj0DLxx+31o12T+VH4U+gO7wz3L+ftjuTxcQaC8GeFVe5qCyXZoDmWKNV9NEyREiZ3azV62bJc5wojZrIIg==} + /@sentry/browser/7.36.0: + resolution: {integrity: sha512-Mu0OpisCZFICBGxVXdHWjUDgSvuQKjnO9acNcXR1+68IU08iX+cU6f2kq6VzI4mW/pNieI20FDFbx9KA0YZ4+A==} engines: {node: '>=8'} dependencies: - '@sentry/core': 7.34.0 - '@sentry/replay': 7.34.0 - '@sentry/types': 7.34.0 - '@sentry/utils': 7.34.0 + '@sentry/core': 7.36.0 + '@sentry/replay': 7.36.0 + '@sentry/types': 7.36.0 + '@sentry/utils': 7.36.0 tslib: 1.14.1 dev: false @@ -6016,44 +6016,44 @@ packages: - supports-color dev: false - /@sentry/core/7.34.0: - resolution: {integrity: sha512-J1oxsYZX1N0tkEcaHt/uuDqk6zOnaivyampp+EvBsUMCdemjg7rwKvawlRB0ZtBEQu3HAhi8zecm03mlpWfCDw==} + /@sentry/core/7.36.0: + resolution: {integrity: sha512-lq1MlcMhvm7QIwUOknFeufkg4M6QREY3s61y6pm1o+o3vSqB7Hz0D19xlyEpP62qMn8OyuttVKOVK1UfGc2EyQ==} engines: {node: '>=8'} dependencies: - '@sentry/types': 7.34.0 - '@sentry/utils': 7.34.0 + '@sentry/types': 7.36.0 + '@sentry/utils': 7.36.0 tslib: 1.14.1 dev: false - /@sentry/integrations/7.34.0: - resolution: {integrity: sha512-xbWnTvG4gkKeCVpmhhdPtMbQkPO0RAfEJ8VPO5TWmUMT23ZWy2kE0gTZHtnBopy7AXxg231XxTi4fxnwgQGxEQ==} + /@sentry/integrations/7.36.0: + resolution: {integrity: sha512-wrRoUqdeGi64NNimGVk8U8DBiXamxTYPBux0/faFDyau8EJyQFcv8zOyB78Za4W2Ss3ZXNaE/WtFF8UxalHzBQ==} engines: {node: '>=8'} dependencies: - '@sentry/types': 7.34.0 - '@sentry/utils': 7.34.0 + '@sentry/types': 7.36.0 + '@sentry/utils': 7.36.0 localforage: 1.10.0 tslib: 1.14.1 dev: false - /@sentry/nextjs/7.34.0_next@13.1.6+react@18.2.0: - resolution: {integrity: sha512-vXtlpONIDU2kT2eA5STLBuGvw5njM7K/7IqjvvkwTwYUpKWs7xZvp7NeHAHpH6LkDSBljokS45fnvfMijEqN7A==} + /@sentry/nextjs/7.36.0_next@13.1.6+react@18.2.0: + resolution: {integrity: sha512-7IUwBjCjo3rWuvEG16D1wKb0D+aMyCU920VGCAQVZaqTZAgrgAKfpTa1Sk0fmDxYglW1EBI9QM+WEnOa9RleLw==} engines: {node: '>=8'} peerDependencies: next: ^10.0.8 || ^11.0 || ^12.0 || ^13.0 - react: 15.x || 16.x || 17.x || 18.x + react: 16.x || 17.x || 18.x webpack: '>= 4.0.0' peerDependenciesMeta: webpack: optional: true dependencies: '@rollup/plugin-commonjs': 24.0.0_rollup@2.78.0 - '@sentry/core': 7.34.0 - '@sentry/integrations': 7.34.0 - '@sentry/node': 7.34.0 - '@sentry/react': 7.34.0_react@18.2.0 - '@sentry/tracing': 7.34.0 - '@sentry/types': 7.34.0 - '@sentry/utils': 7.34.0 + '@sentry/core': 7.36.0 + '@sentry/integrations': 7.36.0 + '@sentry/node': 7.36.0 + '@sentry/react': 7.36.0_react@18.2.0 + '@sentry/tracing': 7.36.0 + '@sentry/types': 7.36.0 + '@sentry/utils': 7.36.0 '@sentry/webpack-plugin': 1.20.0 chalk: 3.0.0 next: 13.1.6_pjwopsidmaokadturxaafygjp4 @@ -6065,13 +6065,13 @@ packages: - supports-color dev: false - /@sentry/node/7.34.0: - resolution: {integrity: sha512-VM4XeydRdgeaNTRe8kwqYg2oNPddVyY74PlCFEFnPEN1NccycNuwiFno68kNrApeqxxLlTTmzkJy0BWo16x2Yg==} + /@sentry/node/7.36.0: + resolution: {integrity: sha512-nAHAY+Rbn5OlTpNX/i6wYrmw3hT/BtwPZ/vNU52cKgw7CpeE1UrCeFjnPn18rQPB7lIh7x0vNvoaPrfemRzpSQ==} engines: {node: '>=8'} dependencies: - '@sentry/core': 7.34.0 - '@sentry/types': 7.34.0 - '@sentry/utils': 7.34.0 + '@sentry/core': 7.36.0 + '@sentry/types': 7.36.0 + '@sentry/utils': 7.36.0 cookie: 0.4.2 https-proxy-agent: 5.0.1 lru_map: 0.3.3 @@ -6080,49 +6080,49 @@ packages: - supports-color dev: false - /@sentry/react/7.34.0_react@18.2.0: - resolution: {integrity: sha512-vdonnZK9R8xyEBDaXNofHyoqy9biNRvlKrQXZp4x8WlYcBCwbU46qxZlSVsxa89pm7yUYS+KHq8cYL801+weqg==} + /@sentry/react/7.36.0_react@18.2.0: + resolution: {integrity: sha512-ttrRqbgeqvkV3DwkDRZC/V8OEnBKGpQf4dKpG8oMlfdVbMTINzrxYUgkhi9xAkxkH9O+vj3Md8L3Rdqw/SDwKQ==} engines: {node: '>=8'} peerDependencies: react: 15.x || 16.x || 17.x || 18.x dependencies: - '@sentry/browser': 7.34.0 - '@sentry/types': 7.34.0 - '@sentry/utils': 7.34.0 + '@sentry/browser': 7.36.0 + '@sentry/types': 7.36.0 + '@sentry/utils': 7.36.0 hoist-non-react-statics: 3.3.2 react: 18.2.0 tslib: 1.14.1 dev: false - /@sentry/replay/7.34.0: - resolution: {integrity: sha512-4L4YZfWt8mcVNcI99RxHORPb308URI1R9xsFj97fagk0ATjexLKr5QCA2ApnKaSn8Q0q1Zdzd4XmFtW9anU45Q==} + /@sentry/replay/7.36.0: + resolution: {integrity: sha512-wNbME74/2GtkqdDXz7NaStyfPWVLjYmN9TFWvu6E9sNl9pkDDvii/Qc8F6ps1wa7bozkKcWRHgNvYiGCxUBHcg==} engines: {node: '>=12'} dependencies: - '@sentry/core': 7.34.0 - '@sentry/types': 7.34.0 - '@sentry/utils': 7.34.0 + '@sentry/core': 7.36.0 + '@sentry/types': 7.36.0 + '@sentry/utils': 7.36.0 dev: false - /@sentry/tracing/7.34.0: - resolution: {integrity: sha512-JtfSWBfcWslfIujcpGEPF5oOiAOCd5shMoWYrdTvCfruHhYjp4w5kv/ndkvq2EpFkcQYhdmtQEytXEO8IJIqRw==} + /@sentry/tracing/7.36.0: + resolution: {integrity: sha512-5R5mfWMDncOcTMmmyYMjgus1vZJzIFw4LHaSbrX7e1IRNT/6vFyNeVxATa2ePXb9mI3XHo5f2p7YrnreAtaSXw==} engines: {node: '>=8'} dependencies: - '@sentry/core': 7.34.0 - '@sentry/types': 7.34.0 - '@sentry/utils': 7.34.0 + '@sentry/core': 7.36.0 + '@sentry/types': 7.36.0 + '@sentry/utils': 7.36.0 tslib: 1.14.1 dev: false - /@sentry/types/7.34.0: - resolution: {integrity: sha512-K+OeHIrl35PSYn6Zwqe4b8WWyAJQoI5NeWxHVkM7oQTGJ1YLG4BvLsR+UiUXnKdR5krE4EDtEA5jLsDlBEyPvw==} + /@sentry/types/7.36.0: + resolution: {integrity: sha512-uvfwUn3okAWSZ948D/xqBrkc3Sn6TeHUgi3+p/dTTNGAXXskzavgfgQ4rSW7f3YD4LL+boZojpoIARVLodMGuA==} engines: {node: '>=8'} dev: false - /@sentry/utils/7.34.0: - resolution: {integrity: sha512-VIHHXEBw0htzqxnU8A7WkXKvmsG2pZVqHlAn0H9W/yyFQtXMuP1j1i0NsjADB/3JXUKK83kTNWGzScXvp0o+Jg==} + /@sentry/utils/7.36.0: + resolution: {integrity: sha512-mgDi5X5Bm0sydCzXpnyKD/sD98yc2qnKXyRdNX4HRRwruhC/P53LT0hGhZXsyqsB/l8OAMl0zWXJLg0xONQsEw==} engines: {node: '>=8'} dependencies: - '@sentry/types': 7.34.0 + '@sentry/types': 7.36.0 tslib: 1.14.1 dev: false @@ -6658,7 +6658,7 @@ packages: /@types/eslint/8.4.10: resolution: {integrity: sha512-Sl/HOqN8NKPmhWo2VBEPm0nvHnu2LL3v9vKo8MEq0EtbJ4eVzGPl41VNPvn5E1i5poMk4/XD8UriLHpJvEP/Nw==} dependencies: - '@types/estree': 0.0.51 + '@types/estree': 1.0.0 '@types/json-schema': 7.0.11 /@types/estree/0.0.51: @@ -8973,7 +8973,6 @@ packages: domelementtype: 2.3.0 domhandler: 5.0.3 domutils: 3.0.1 - dev: false /cheerio/1.0.0-rc.10: resolution: {integrity: sha512-g0J0q/O6mW8z5zxQ3A8E8J1hUgp4SMOvEoW/x84OwyHKe/Zccz83PVT4y5Crcr530FV6NgmKI1qvGTKVl9XXVw==} @@ -8998,7 +8997,6 @@ packages: htmlparser2: 8.0.1 parse5: 7.1.2 parse5-htmlparser2-tree-adapter: 7.0.0 - dev: false /chokidar/3.5.3: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} @@ -9695,7 +9693,6 @@ packages: domhandler: 5.0.3 domutils: 3.0.1 nth-check: 2.1.1 - dev: false /css-to-react-native/3.1.0: resolution: {integrity: sha512-AryfkFA29b4I3vG7N4kxFboq15DxwSXzhXM37XNEjwJMgjYIc8BcqfiprpAqX0zadI5PMByEIwAMzXxk5Vcc4g==} @@ -14030,7 +14027,7 @@ packages: engines: {node: '>=10.0.0'} hasBin: true dependencies: - cheerio: 1.0.0-rc.10 + cheerio: 1.0.0-rc.12 commander: 5.1.0 mensch: 0.3.4 slick: 1.12.2 @@ -15728,7 +15725,6 @@ packages: dependencies: domhandler: 5.0.3 parse5: 7.1.2 - dev: false /parse5/5.1.1: resolution: {integrity: sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==} @@ -20142,7 +20138,7 @@ packages: /wide-align/1.1.5: resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} dependencies: - string-width: 1.0.2 + string-width: 4.2.3 dev: false /widest-line/3.1.0: