Title: Typescript Mismatch · Issue #4560 · getsentry/sentry-javascript · GitHub
Open Graph Title: Typescript Mismatch · Issue #4560 · getsentry/sentry-javascript
X Title: Typescript Mismatch · Issue #4560 · getsentry/sentry-javascript
Description: https://github.com/vercel/next.js/blob/canary/packages/next/server/config-shared.ts#L46 https://github.com/getsentry/sentry-javascript/blob/master/packages/nextjs/src/config/types.ts#L58 The types from @sentry/nextjs and next don't match...
Open Graph Description: https://github.com/vercel/next.js/blob/canary/packages/next/server/config-shared.ts#L46 https://github.com/getsentry/sentry-javascript/blob/master/packages/nextjs/src/config/types.ts#L58 The types ...
X Description: https://github.com/vercel/next.js/blob/canary/packages/next/server/config-shared.ts#L46 https://github.com/getsentry/sentry-javascript/blob/master/packages/nextjs/src/config/types.ts#L58 The types ...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/4560
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Typescript Mismatch","articleBody":"https://github.com/vercel/next.js/blob/canary/packages/next/server/config-shared.ts#L46\r\nhttps://github.com/getsentry/sentry-javascript/blob/master/packages/nextjs/src/config/types.ts#L58\r\n\r\nThe types from @sentry/nextjs and next don't match when it comes to webpack build context. Something as simple as this has a type error:\r\n\r\n```typescript\r\nconst { withSentryConfig } = require(\"@sentry/nextjs\");\r\n\r\n/**\r\n * @type {import('next').NextConfig}\r\n */\r\nconst config = {\r\n webpack: (config) => ({\r\n ...config,\r\n module: {\r\n ...config.module,\r\n rules: [\r\n ...config.module.rules,\r\n someRule,\r\n ],\r\n },\r\n }),\r\n};\r\n\r\nmodule.exports = withSentryConfig(config, {\r\n validate: true,\r\n});\r\n```\r\n\r\n\r\n```\r\n TSError: ⨯ Unable to compile TypeScript:\r\nnext.config.js:28:35 - error TS2345: Argument of type 'NextConfig' is not assignable to parameter of type 'ExportedNextConfig | undefined'.\r\n Type 'NextConfig' is not assignable to type 'Partial\u003cNextConfigObject>'.\r\n Types of property 'webpack' are incompatible.\r\n Type '((config: any, context: { dir: string; dev: boolean; isServer: boolean; buildId: string; config: NextConfigComplete; defaultLoaders: { babel: any; }; totalPages: number; webpack: any; }) => any) | null | undefined' is not assignable to type 'WebpackConfigFunction | undefined'.\r\n Type 'null' is not assignable to type 'WebpackConfigFunction | undefined'.\r\n\r\n28 module.exports = withSentryConfig(config, {\r\n ~~~~~~\r\n```\r\n\r\nInstead of building our own `NextConfigObject` type, next exports its own `import('next').NextConfig` type. We should be extending it to ensure compatibility rather than redefining it and hoping they correlate.","author":{"url":"https://github.com/saiichihashimoto","@type":"Person","name":"saiichihashimoto"},"datePublished":"2022-02-12T01:38:05Z","url":"https://github.com/getsentry/sentry-javascript/issues/4560"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5f9bebe3-f2be-1bec-a131-e1d8eeee7daa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E9E8:24A077:3634FE:48892C:6B04B9E4 |
| html-safe-nonce | bf29e014bd645cc9c55b1a11ccc665d23b448011e4295c876bd2a263478b3ed1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOUU4OjI0QTA3NzozNjM0RkU6NDg4OTJDOjZCMDRCOUU0IiwidmlzaXRvcl9pZCI6IjY4MDQ2Mjk0ODMyNzkzOTkzOTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 90a5bbaad26db58e289ecade8038da1f3ba7191b5dfae8cf56fbfec3036ec501 |
| hovercard-subject-tag | issue:1133478186 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/4560/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1cd27dd0026e832df205ea7d8ea0fc6ed50684487ac938d1dc491a1b4e3dc0fb/getsentry/sentry-javascript/issues/4560 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1cd27dd0026e832df205ea7d8ea0fc6ed50684487ac938d1dc491a1b4e3dc0fb/getsentry/sentry-javascript/issues/4560 |
| og:image:alt | https://github.com/vercel/next.js/blob/canary/packages/next/server/config-shared.ts#L46 https://github.com/getsentry/sentry-javascript/blob/master/packages/nextjs/src/config/types.ts#L58 The types ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | saiichihashimoto |
| hostname | github.com |
| expected-hostname | github.com |
| None | 378bd702ac792b3550e484ad39d9a898fcd25bb52ba6962b0c9cc457c1ea71c7 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b032e77f1ea437ede6c115446a0a467709b468e7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width