next 15.2.0-canary.65 → 15.2.0-canary.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of next might be problematic. Click here for more details.

Files changed (334) hide show
  1. package/dist/bin/next +5 -1
  2. package/dist/bin/next.map +1 -1
  3. package/dist/build/entries.d.ts +1 -0
  4. package/dist/build/entries.js +12 -1
  5. package/dist/build/entries.js.map +1 -1
  6. package/dist/build/index.js +3 -3
  7. package/dist/build/index.js.map +1 -1
  8. package/dist/build/swc/index.js +1 -1
  9. package/dist/build/webpack/config/blocks/base.js +3 -1
  10. package/dist/build/webpack/config/blocks/base.js.map +1 -1
  11. package/dist/build/webpack/config/blocks/css/index.js +3 -1
  12. package/dist/build/webpack/config/blocks/css/index.js.map +1 -1
  13. package/dist/build/webpack/config/blocks/css/loaders/client.js +3 -1
  14. package/dist/build/webpack/config/blocks/css/loaders/client.js.map +1 -1
  15. package/dist/build/webpack/loaders/next-flight-client-entry-loader.js +4 -0
  16. package/dist/build/webpack/loaders/next-flight-client-entry-loader.js.map +1 -1
  17. package/dist/build/webpack/loaders/next-flight-client-module-loader.js +7 -1
  18. package/dist/build/webpack/loaders/next-flight-client-module-loader.js.map +1 -1
  19. package/dist/build/webpack/loaders/next-flight-loader/index.js +8 -2
  20. package/dist/build/webpack/loaders/next-flight-loader/index.js.map +1 -1
  21. package/dist/build/webpack/loaders/utils.js +1 -1
  22. package/dist/build/webpack/loaders/utils.js.map +1 -1
  23. package/dist/build/webpack/plugins/build-manifest-plugin.d.ts +1 -1
  24. package/dist/build/webpack/plugins/build-manifest-plugin.js +13 -4
  25. package/dist/build/webpack/plugins/build-manifest-plugin.js.map +1 -1
  26. package/dist/build/webpack/plugins/flight-client-entry-plugin.d.ts +1 -1
  27. package/dist/build/webpack/plugins/flight-client-entry-plugin.js +28 -18
  28. package/dist/build/webpack/plugins/flight-client-entry-plugin.js.map +1 -1
  29. package/dist/build/webpack/plugins/flight-manifest-plugin.js +3 -3
  30. package/dist/build/webpack/plugins/flight-manifest-plugin.js.map +1 -1
  31. package/dist/build/webpack/plugins/middleware-plugin.js +6 -3
  32. package/dist/build/webpack/plugins/middleware-plugin.js.map +1 -1
  33. package/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js +11 -1
  34. package/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js.map +1 -1
  35. package/dist/build/webpack/plugins/nextjs-require-cache-hot-reloader.js +1 -1
  36. package/dist/build/webpack/plugins/nextjs-require-cache-hot-reloader.js.map +1 -1
  37. package/dist/build/webpack/plugins/rspack-flight-client-entry-plugin.d.ts +36 -0
  38. package/dist/build/webpack/plugins/rspack-flight-client-entry-plugin.js +97 -0
  39. package/dist/build/webpack/plugins/rspack-flight-client-entry-plugin.js.map +1 -0
  40. package/dist/build/webpack/plugins/rspack-profiling-plugin.d.ts +9 -0
  41. package/dist/build/webpack/plugins/rspack-profiling-plugin.js +62 -0
  42. package/dist/build/webpack/plugins/rspack-profiling-plugin.js.map +1 -0
  43. package/dist/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js +2 -1
  44. package/dist/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js.map +1 -1
  45. package/dist/build/webpack/utils.js +6 -2
  46. package/dist/build/webpack/utils.js.map +1 -1
  47. package/dist/build/webpack-config.js +37 -5
  48. package/dist/build/webpack-config.js.map +1 -1
  49. package/dist/client/app-bootstrap.js +1 -1
  50. package/dist/client/app-dir/link.js +2 -0
  51. package/dist/client/app-dir/link.js.map +1 -1
  52. package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js +34 -26
  53. package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js.map +1 -1
  54. package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js +1 -0
  55. package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js.map +1 -1
  56. package/dist/client/components/react-dev-overlay/_experimental/font/font-styles.d.ts +1 -0
  57. package/dist/client/components/react-dev-overlay/_experimental/font/font-styles.js +41 -0
  58. package/dist/client/components/react-dev-overlay/_experimental/font/font-styles.js.map +1 -0
  59. package/dist/client/components/react-dev-overlay/_experimental/font/geist-latin-ext.woff2 +0 -0
  60. package/dist/client/components/react-dev-overlay/_experimental/font/geist-latin.woff2 +0 -0
  61. package/dist/client/components/react-dev-overlay/_experimental/font/geist-mono-latin-ext.woff2 +0 -0
  62. package/dist/client/components/react-dev-overlay/_experimental/font/geist-mono-latin.woff2 +0 -0
  63. package/dist/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.d.ts +2 -0
  64. package/dist/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js +72 -0
  65. package/dist/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js.map +1 -0
  66. package/dist/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js +16 -8
  67. package/dist/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js.map +1 -1
  68. package/dist/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js +3 -3
  69. package/dist/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js.map +1 -1
  70. package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js +2 -1
  71. package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js.map +1 -1
  72. package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js +1 -1
  73. package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js.map +1 -1
  74. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.d.ts +2 -1
  75. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js +82 -31
  76. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js.map +1 -1
  77. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.d.ts +2 -2
  78. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js +20 -21
  79. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js.map +1 -1
  80. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.d.ts +8 -0
  81. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js +80 -0
  82. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js.map +1 -0
  83. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.d.ts +9 -0
  84. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js +158 -0
  85. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js.map +1 -0
  86. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.d.ts +8 -0
  87. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js +212 -0
  88. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js.map +1 -0
  89. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.d.ts +1 -0
  90. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js +28 -6
  91. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js.map +1 -1
  92. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js +1 -1
  93. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js.map +1 -1
  94. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.d.ts +2 -2
  95. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js +3 -3
  96. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js.map +1 -1
  97. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.d.ts +2 -2
  98. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js +4 -4
  99. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js.map +1 -1
  100. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.d.ts +2 -2
  101. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js +2 -2
  102. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js.map +1 -1
  103. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js +1 -1
  104. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js.map +1 -1
  105. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.d.ts +2 -2
  106. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js +9 -9
  107. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js.map +1 -1
  108. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js +4 -4
  109. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js.map +1 -1
  110. package/dist/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js +15 -10
  111. package/dist/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js.map +1 -1
  112. package/dist/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js +3 -1
  113. package/dist/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js.map +1 -1
  114. package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.d.ts +2 -2
  115. package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.js +7 -7
  116. package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.js.map +1 -1
  117. package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js +5 -5
  118. package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js.map +1 -1
  119. package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js +1 -1
  120. package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js.map +1 -1
  121. package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.d.ts +1 -1
  122. package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js +4 -12
  123. package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js.map +1 -1
  124. package/dist/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js +3 -1
  125. package/dist/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js.map +1 -1
  126. package/dist/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.d.ts +1 -0
  127. package/dist/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js +34 -0
  128. package/dist/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js.map +1 -0
  129. package/dist/client/components/react-dev-overlay/_experimental/internal/styles/base.js +2 -2
  130. package/dist/client/components/react-dev-overlay/_experimental/internal/styles/base.js.map +1 -1
  131. package/dist/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js +7 -1
  132. package/dist/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js.map +1 -1
  133. package/dist/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js +6 -2
  134. package/dist/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js.map +1 -1
  135. package/dist/client/components/react-dev-overlay/hydration-diff/diff-view.js +2 -2
  136. package/dist/client/components/react-dev-overlay/hydration-diff/diff-view.js.map +1 -1
  137. package/dist/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js +4 -4
  138. package/dist/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js.map +1 -1
  139. package/dist/client/components/react-dev-overlay/server/middleware-response.d.ts +9 -0
  140. package/dist/client/components/react-dev-overlay/server/middleware-response.js +46 -0
  141. package/dist/client/components/react-dev-overlay/server/middleware-response.js.map +1 -0
  142. package/dist/client/components/react-dev-overlay/server/middleware-turbopack.js +13 -12
  143. package/dist/client/components/react-dev-overlay/server/middleware-turbopack.js.map +1 -1
  144. package/dist/client/components/react-dev-overlay/server/middleware-webpack.js +12 -11
  145. package/dist/client/components/react-dev-overlay/server/middleware-webpack.js.map +1 -1
  146. package/dist/client/components/react-dev-overlay/server/shared.d.ts +0 -7
  147. package/dist/client/components/react-dev-overlay/server/shared.js +1 -51
  148. package/dist/client/components/react-dev-overlay/server/shared.js.map +1 -1
  149. package/dist/client/components/react-dev-overlay/shared.d.ts +1 -0
  150. package/dist/client/components/react-dev-overlay/shared.js +2 -0
  151. package/dist/client/components/react-dev-overlay/shared.js.map +1 -1
  152. package/dist/client/index.js +2 -3
  153. package/dist/client/index.js.map +1 -1
  154. package/dist/client/link.js.map +1 -1
  155. package/dist/compiled/@next/font/dist/google/fetch-css-from-google-fonts.js +8 -44
  156. package/dist/compiled/@next/font/dist/google/fetch-font-file.d.ts +2 -1
  157. package/dist/compiled/@next/font/dist/google/fetch-font-file.js +6 -20
  158. package/dist/compiled/@next/font/dist/google/fetch-resource.d.ts +6 -0
  159. package/dist/compiled/@next/font/dist/google/fetch-resource.js +46 -0
  160. package/dist/compiled/next-server/app-page-experimental.runtime.dev.js +3 -3
  161. package/dist/compiled/next-server/app-page-experimental.runtime.dev.js.map +1 -1
  162. package/dist/compiled/next-server/app-page.runtime.dev.js +3 -3
  163. package/dist/compiled/next-server/app-page.runtime.dev.js.map +1 -1
  164. package/dist/compiled/next-server/server.runtime.prod.js +2 -2
  165. package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
  166. package/dist/compiled/node-fetch/index.js +1 -1
  167. package/dist/compiled/sass-loader/cjs.js +1 -1
  168. package/dist/compiled/webpack/webpack.js +23 -1
  169. package/dist/esm/build/entries.js +9 -2
  170. package/dist/esm/build/entries.js.map +1 -1
  171. package/dist/esm/build/index.js +3 -3
  172. package/dist/esm/build/index.js.map +1 -1
  173. package/dist/esm/build/swc/index.js +1 -1
  174. package/dist/esm/build/webpack/config/blocks/base.js +3 -1
  175. package/dist/esm/build/webpack/config/blocks/base.js.map +1 -1
  176. package/dist/esm/build/webpack/config/blocks/css/index.js +3 -1
  177. package/dist/esm/build/webpack/config/blocks/css/index.js.map +1 -1
  178. package/dist/esm/build/webpack/config/blocks/css/loaders/client.js +3 -1
  179. package/dist/esm/build/webpack/config/blocks/css/loaders/client.js.map +1 -1
  180. package/dist/esm/build/webpack/loaders/next-flight-client-entry-loader.js +4 -0
  181. package/dist/esm/build/webpack/loaders/next-flight-client-entry-loader.js.map +1 -1
  182. package/dist/esm/build/webpack/loaders/next-flight-client-module-loader.js +7 -1
  183. package/dist/esm/build/webpack/loaders/next-flight-client-module-loader.js.map +1 -1
  184. package/dist/esm/build/webpack/loaders/next-flight-loader/index.js +8 -2
  185. package/dist/esm/build/webpack/loaders/next-flight-loader/index.js.map +1 -1
  186. package/dist/esm/build/webpack/loaders/utils.js +1 -1
  187. package/dist/esm/build/webpack/loaders/utils.js.map +1 -1
  188. package/dist/esm/build/webpack/plugins/build-manifest-plugin.js +14 -5
  189. package/dist/esm/build/webpack/plugins/build-manifest-plugin.js.map +1 -1
  190. package/dist/esm/build/webpack/plugins/flight-client-entry-plugin.js +28 -18
  191. package/dist/esm/build/webpack/plugins/flight-client-entry-plugin.js.map +1 -1
  192. package/dist/esm/build/webpack/plugins/flight-manifest-plugin.js +3 -3
  193. package/dist/esm/build/webpack/plugins/flight-manifest-plugin.js.map +1 -1
  194. package/dist/esm/build/webpack/plugins/middleware-plugin.js +6 -3
  195. package/dist/esm/build/webpack/plugins/middleware-plugin.js.map +1 -1
  196. package/dist/esm/build/webpack/plugins/next-trace-entrypoints-plugin.js +11 -1
  197. package/dist/esm/build/webpack/plugins/next-trace-entrypoints-plugin.js.map +1 -1
  198. package/dist/esm/build/webpack/plugins/nextjs-require-cache-hot-reloader.js +1 -1
  199. package/dist/esm/build/webpack/plugins/nextjs-require-cache-hot-reloader.js.map +1 -1
  200. package/dist/esm/build/webpack/plugins/rspack-flight-client-entry-plugin.js +87 -0
  201. package/dist/esm/build/webpack/plugins/rspack-flight-client-entry-plugin.js.map +1 -0
  202. package/dist/esm/build/webpack/plugins/rspack-profiling-plugin.js +40 -0
  203. package/dist/esm/build/webpack/plugins/rspack-profiling-plugin.js.map +1 -0
  204. package/dist/esm/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js +2 -1
  205. package/dist/esm/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js.map +1 -1
  206. package/dist/esm/build/webpack/utils.js +6 -2
  207. package/dist/esm/build/webpack/utils.js.map +1 -1
  208. package/dist/esm/build/webpack-config.js +37 -5
  209. package/dist/esm/build/webpack-config.js.map +1 -1
  210. package/dist/esm/client/app-bootstrap.js +1 -1
  211. package/dist/esm/client/app-dir/link.js +2 -0
  212. package/dist/esm/client/app-dir/link.js.map +1 -1
  213. package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js +34 -26
  214. package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js.map +1 -1
  215. package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js +1 -0
  216. package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js.map +1 -1
  217. package/dist/esm/client/components/react-dev-overlay/_experimental/font/font-styles.js +25 -0
  218. package/dist/esm/client/components/react-dev-overlay/_experimental/font/font-styles.js.map +1 -0
  219. package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-latin-ext.woff2 +0 -0
  220. package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-latin.woff2 +0 -0
  221. package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-mono-latin-ext.woff2 +0 -0
  222. package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-mono-latin.woff2 +0 -0
  223. package/dist/esm/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js +54 -0
  224. package/dist/esm/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js.map +1 -0
  225. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js +16 -8
  226. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js.map +1 -1
  227. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js +3 -3
  228. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js.map +1 -1
  229. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js +2 -1
  230. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js.map +1 -1
  231. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js +1 -1
  232. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js.map +1 -1
  233. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js +83 -31
  234. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js.map +1 -1
  235. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js +13 -14
  236. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js.map +1 -1
  237. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js +52 -0
  238. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js.map +1 -0
  239. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js +130 -0
  240. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js.map +1 -0
  241. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js +184 -0
  242. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js.map +1 -0
  243. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js +28 -6
  244. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js.map +1 -1
  245. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js +1 -1
  246. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js.map +1 -1
  247. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js +3 -3
  248. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js.map +1 -1
  249. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js +4 -4
  250. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js.map +1 -1
  251. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js +2 -2
  252. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js.map +1 -1
  253. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js +1 -1
  254. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js.map +1 -1
  255. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js +9 -9
  256. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js.map +1 -1
  257. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js +4 -4
  258. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js.map +1 -1
  259. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js +15 -10
  260. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js.map +1 -1
  261. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js +3 -1
  262. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js.map +1 -1
  263. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.js +7 -7
  264. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.js.map +1 -1
  265. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js +5 -5
  266. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js.map +1 -1
  267. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js +1 -1
  268. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js.map +1 -1
  269. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js +4 -12
  270. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js.map +1 -1
  271. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js +3 -1
  272. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js.map +1 -1
  273. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js +18 -0
  274. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js.map +1 -0
  275. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/base.js +2 -2
  276. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/base.js.map +1 -1
  277. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js +7 -1
  278. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js.map +1 -1
  279. package/dist/esm/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js +6 -2
  280. package/dist/esm/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js.map +1 -1
  281. package/dist/esm/client/components/react-dev-overlay/hydration-diff/diff-view.js +1 -1
  282. package/dist/esm/client/components/react-dev-overlay/hydration-diff/diff-view.js.map +1 -1
  283. package/dist/esm/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js +4 -4
  284. package/dist/esm/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js.map +1 -1
  285. package/dist/esm/client/components/react-dev-overlay/server/middleware-response.js +30 -0
  286. package/dist/esm/client/components/react-dev-overlay/server/middleware-response.js.map +1 -0
  287. package/dist/esm/client/components/react-dev-overlay/server/middleware-turbopack.js +14 -13
  288. package/dist/esm/client/components/react-dev-overlay/server/middleware-turbopack.js.map +1 -1
  289. package/dist/esm/client/components/react-dev-overlay/server/middleware-webpack.js +13 -12
  290. package/dist/esm/client/components/react-dev-overlay/server/middleware-webpack.js.map +1 -1
  291. package/dist/esm/client/components/react-dev-overlay/server/shared.js +0 -26
  292. package/dist/esm/client/components/react-dev-overlay/server/shared.js.map +1 -1
  293. package/dist/esm/client/components/react-dev-overlay/shared.js +2 -0
  294. package/dist/esm/client/components/react-dev-overlay/shared.js.map +1 -1
  295. package/dist/esm/client/index.js +2 -3
  296. package/dist/esm/client/index.js.map +1 -1
  297. package/dist/esm/client/link.js.map +1 -1
  298. package/dist/esm/server/base-server.js +15 -15
  299. package/dist/esm/server/base-server.js.map +1 -1
  300. package/dist/esm/server/config-shared.js.map +1 -1
  301. package/dist/esm/server/config.js +1 -1
  302. package/dist/esm/server/dev/hot-reloader-turbopack.js +4 -2
  303. package/dist/esm/server/dev/hot-reloader-turbopack.js.map +1 -1
  304. package/dist/esm/server/dev/hot-reloader-webpack.js +4 -2
  305. package/dist/esm/server/dev/hot-reloader-webpack.js.map +1 -1
  306. package/dist/esm/server/lib/app-info-log.js +1 -1
  307. package/dist/esm/server/lib/start-server.js +1 -1
  308. package/dist/esm/shared/lib/get-rspack.js +32 -0
  309. package/dist/esm/shared/lib/get-rspack.js.map +1 -0
  310. package/dist/server/base-server.js +15 -15
  311. package/dist/server/base-server.js.map +1 -1
  312. package/dist/server/config-shared.d.ts +3 -3
  313. package/dist/server/config-shared.js.map +1 -1
  314. package/dist/server/config.js +1 -1
  315. package/dist/server/dev/hot-reloader-turbopack.js +4 -2
  316. package/dist/server/dev/hot-reloader-turbopack.js.map +1 -1
  317. package/dist/server/dev/hot-reloader-webpack.js +4 -2
  318. package/dist/server/dev/hot-reloader-webpack.js.map +1 -1
  319. package/dist/server/lib/app-info-log.js +1 -1
  320. package/dist/server/lib/start-server.js +1 -1
  321. package/dist/shared/lib/get-rspack.d.ts +2 -0
  322. package/dist/shared/lib/get-rspack.js +54 -0
  323. package/dist/shared/lib/get-rspack.js.map +1 -0
  324. package/dist/telemetry/anonymous-meta.js +1 -1
  325. package/dist/telemetry/events/session-stopped.js +2 -2
  326. package/dist/telemetry/events/version.js +2 -2
  327. package/dist/trace/trace-uploader.js +1 -2
  328. package/dist/trace/trace-uploader.js.map +1 -1
  329. package/package.json +15 -15
  330. package/dist/client/components/react-dev-overlay/internal/icons/CollapseIcon.d.ts +0 -3
  331. package/dist/client/components/react-dev-overlay/internal/icons/CollapseIcon.js +0 -43
  332. package/dist/client/components/react-dev-overlay/internal/icons/CollapseIcon.js.map +0 -1
  333. package/dist/esm/client/components/react-dev-overlay/internal/icons/CollapseIcon.js +0 -27
  334. package/dist/esm/client/components/react-dev-overlay/internal/icons/CollapseIcon.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/client/components/react-dev-overlay/server/middleware-webpack.ts"],"sourcesContent":["import { constants as FS, promises as fs } from 'fs'\nimport { findSourceMap, type SourceMap } from 'module'\nimport path from 'path'\nimport { fileURLToPath, pathToFileURL } from 'url'\nimport {\n SourceMapConsumer,\n type BasicSourceMapConsumer,\n} from 'next/dist/compiled/source-map08'\nimport type { StackFrame } from 'next/dist/compiled/stacktrace-parser'\nimport { getSourceMapFromFile } from '../internal/helpers/get-source-map-from-file'\nimport { launchEditor } from '../internal/helpers/launchEditor'\nimport {\n badRequest,\n getOriginalCodeFrame,\n internalServerError,\n json,\n noContent,\n notFound,\n type OriginalStackFrameResponse,\n type OriginalStackFramesRequest,\n type OriginalStackFramesResponse,\n} from './shared'\nexport { getServerError } from '../internal/helpers/node-stack-frames'\nexport { parseStack } from '../internal/helpers/parse-stack'\nexport { getSourceMapFromFile }\n\nimport type { IncomingMessage, ServerResponse } from 'http'\nimport type webpack from 'webpack'\nimport type {\n NullableMappedPosition,\n RawSourceMap,\n} from 'next/dist/compiled/source-map08'\nimport { formatFrameSourceFile } from '../internal/helpers/webpack-module-path'\nimport type { MappedPosition } from 'source-map'\nimport { inspect } from 'util'\n\nfunction shouldIgnoreSource(sourceURL: string): boolean {\n return (\n sourceURL.includes('node_modules') ||\n // Only relevant for when Next.js is symlinked e.g. in the Next.js monorepo\n sourceURL.includes('next/dist') ||\n sourceURL.startsWith('node:')\n )\n}\n\ntype IgnoredSources = Array<{ url: string; ignored: boolean }>\n\nexport interface IgnorableStackFrame extends StackFrame {\n ignored: boolean\n}\n\ntype SourceAttributes = {\n sourcePosition: NullableMappedPosition\n sourceContent: string | null\n}\n\ntype Source =\n | {\n type: 'file'\n sourceMap: RawSourceMap\n ignoredSources: IgnoredSources\n moduleURL: string\n }\n | {\n type: 'bundle'\n sourceMap: RawSourceMap\n ignoredSources: IgnoredSources\n compilation: webpack.Compilation\n moduleId: string\n moduleURL: string\n }\n\nfunction getModuleById(\n id: string | undefined,\n compilation: webpack.Compilation\n) {\n const { chunkGraph, modules } = compilation\n\n return [...modules].find((module) => chunkGraph.getModuleId(module) === id)\n}\n\nfunction findModuleNotFoundFromError(errorMessage: string | undefined) {\n return errorMessage?.match(/'([^']+)' module/)?.[1]\n}\n\nfunction getSourcePath(source: string) {\n if (source.startsWith('file://')) {\n return fileURLToPath(source)\n }\n return source.replace(/^(webpack:\\/\\/\\/|webpack:\\/\\/|webpack:\\/\\/_N_E\\/)/, '')\n}\n\n/**\n * @returns 1-based lines and 0-based columns\n */\nasync function findOriginalSourcePositionAndContent(\n sourceMap: RawSourceMap,\n position: { lineNumber: number | null; column: number | null }\n): Promise<SourceAttributes | null> {\n let consumer: BasicSourceMapConsumer\n try {\n consumer = await new SourceMapConsumer(sourceMap)\n } catch (cause) {\n throw new Error(\n `${sourceMap.file}: Invalid source map. Only conformant source maps can be used to find the original code.`,\n { cause }\n )\n }\n\n try {\n const sourcePosition = consumer.originalPositionFor({\n line: position.lineNumber ?? 1,\n // 0-based columns out requires 0-based columns in.\n column: (position.column ?? 1) - 1,\n })\n\n if (!sourcePosition.source) {\n return null\n }\n\n const sourceContent: string | null =\n consumer.sourceContentFor(\n sourcePosition.source,\n /* returnNullOnMissing */ true\n ) ?? null\n\n return {\n sourcePosition,\n sourceContent,\n }\n } finally {\n consumer.destroy()\n }\n}\n\nexport function getIgnoredSources(\n sourceMap: RawSourceMap & { ignoreList?: number[] }\n): IgnoredSources {\n const ignoreList = new Set<number>(sourceMap.ignoreList ?? [])\n const moduleFilenames = sourceMap?.sources ?? []\n\n for (let index = 0; index < moduleFilenames.length; index++) {\n // bundlerFilePath case: webpack://./app/page.tsx\n const webpackSourceURL = moduleFilenames[index]\n // Format the path to the normal file path\n const formattedFilePath = formatFrameSourceFile(webpackSourceURL)\n if (shouldIgnoreSource(formattedFilePath)) {\n ignoreList.add(index)\n }\n }\n\n const ignoredSources = sourceMap.sources.map((source, index) => {\n return {\n url: source,\n ignored: ignoreList.has(sourceMap.sources.indexOf(source)),\n content: sourceMap.sourcesContent?.[index] ?? null,\n }\n })\n return ignoredSources\n}\n\nfunction isIgnoredSource(\n source: Source,\n sourcePosition: MappedPosition | NullableMappedPosition\n) {\n if (sourcePosition.source == null) {\n return true\n }\n for (const ignoredSource of source.ignoredSources) {\n if (ignoredSource.ignored && ignoredSource.url === sourcePosition.source) {\n return true\n }\n }\n\n return false\n}\n\nfunction findOriginalSourcePositionAndContentFromCompilation(\n moduleId: string | undefined,\n importedModule: string,\n compilation: webpack.Compilation\n): SourceAttributes | null {\n const module = getModuleById(moduleId, compilation)\n return module?.buildInfo?.importLocByPath?.get(importedModule) ?? null\n}\n\nexport async function createOriginalStackFrame({\n source,\n rootDirectory,\n frame,\n errorMessage,\n}: {\n source: Source\n rootDirectory: string\n frame: StackFrame\n errorMessage?: string\n}): Promise<OriginalStackFrameResponse | null> {\n const moduleNotFound = findModuleNotFoundFromError(errorMessage)\n const result = await (() => {\n if (moduleNotFound) {\n if (source.type === 'file') {\n return undefined\n }\n\n return findOriginalSourcePositionAndContentFromCompilation(\n source.moduleId,\n moduleNotFound,\n source.compilation\n )\n }\n return findOriginalSourcePositionAndContent(source.sourceMap, frame)\n })()\n\n if (!result) {\n return null\n }\n const { sourcePosition, sourceContent } = result\n\n if (!sourcePosition.source) {\n return null\n }\n\n const ignored =\n isIgnoredSource(source, sourcePosition) ||\n // If the source file is externals, should be excluded even it's not ignored source.\n // e.g. webpack://next/dist/.. needs to be ignored\n shouldIgnoreSource(source.moduleURL)\n\n const sourcePath = getSourcePath(\n // When sourcePosition.source is the loader path the modulePath is generally better.\n (sourcePosition.source!.includes('|')\n ? source.moduleURL\n : sourcePosition.source) || source.moduleURL\n )\n const filePath = path.resolve(rootDirectory, sourcePath)\n const resolvedFilePath = path.relative(rootDirectory, filePath)\n\n const traced: IgnorableStackFrame = {\n file: resolvedFilePath,\n lineNumber: sourcePosition.line,\n column: (sourcePosition.column ?? 0) + 1,\n methodName:\n // We ignore the sourcemapped name since it won't be the correct name.\n // The callsite will point to the column of the variable name instead of the\n // name of the enclosing function.\n // TODO(NDX-531): Spy on prepareStackTrace to get the enclosing line number for method name mapping.\n // default is not a valid identifier in JS so webpack uses a custom variable when it's an unnamed default export\n // Resolve it back to `default` for the method name if the source position didn't have the method.\n frame.methodName\n ?.replace('__WEBPACK_DEFAULT_EXPORT__', 'default')\n ?.replace('__webpack_exports__.', ''),\n arguments: [],\n ignored,\n }\n\n return {\n originalStackFrame: traced,\n originalCodeFrame: getOriginalCodeFrame(traced, sourceContent),\n }\n}\n\nasync function getSourceMapFromCompilation(\n id: string,\n compilation: webpack.Compilation\n): Promise<RawSourceMap | undefined> {\n try {\n const module = getModuleById(id, compilation)\n\n if (!module) {\n return undefined\n }\n\n // @ts-expect-error The types for `CodeGenerationResults.get` require a\n // runtime to be passed as second argument, but apparently it also works\n // without it.\n const codeGenerationResult = compilation.codeGenerationResults.get(module)\n const source = codeGenerationResult?.sources.get('javascript')\n\n return source?.map() ?? undefined\n } catch (err) {\n console.error(`Failed to lookup module by ID (\"${id}\"):`, err)\n return undefined\n }\n}\n\nasync function getSource(\n sourceURL: string,\n options: {\n getCompilations: () => webpack.Compilation[]\n }\n): Promise<Source | undefined> {\n const { getCompilations } = options\n\n let nativeSourceMap: SourceMap | undefined\n try {\n nativeSourceMap = findSourceMap(sourceURL)\n } catch (cause) {\n throw new Error(\n `${sourceURL}: Invalid source map. Only conformant source maps can be used to find the original code.`,\n { cause }\n )\n }\n\n if (nativeSourceMap !== undefined) {\n const sourceMapPayload = nativeSourceMap.payload\n return {\n type: 'file',\n sourceMap: sourceMapPayload,\n ignoredSources: getIgnoredSources(sourceMapPayload),\n moduleURL: sourceURL,\n }\n }\n\n if (path.isAbsolute(sourceURL)) {\n sourceURL = pathToFileURL(sourceURL).href\n }\n\n if (sourceURL.startsWith('file:')) {\n const sourceMap = await getSourceMapFromFile(sourceURL)\n return sourceMap\n ? {\n type: 'file',\n sourceMap,\n ignoredSources: getIgnoredSources(sourceMap),\n moduleURL: sourceURL,\n }\n : undefined\n }\n\n // webpack-internal:///./src/hello.tsx => ./src/hello.tsx\n // rsc://React/Server/webpack-internal:///(rsc)/./src/hello.tsx?42 => (rsc)/./src/hello.tsx\n // webpack://_N_E/./src/hello.tsx => ./src/hello.tsx\n const moduleId = sourceURL\n .replace(\n /^(rsc:\\/\\/React\\/[^/]+\\/)?(webpack-internal:\\/\\/\\/|webpack:\\/\\/(_N_E\\/)?)/,\n ''\n )\n .replace(/\\?\\d+$/, '')\n\n // (rsc)/./src/hello.tsx => ./src/hello.tsx\n const moduleURL = moduleId.replace(/^(\\(.*\\)\\/?)/, '')\n\n for (const compilation of getCompilations()) {\n const sourceMap = await getSourceMapFromCompilation(moduleId, compilation)\n\n if (sourceMap) {\n const ignoredSources = getIgnoredSources(sourceMap)\n return {\n type: 'bundle',\n sourceMap,\n compilation,\n moduleId,\n moduleURL,\n ignoredSources,\n }\n }\n }\n\n return undefined\n}\n\nfunction getOriginalStackFrames({\n isServer,\n isEdgeServer,\n isAppDirectory,\n frames,\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n}: {\n isServer: boolean\n isEdgeServer: boolean\n isAppDirectory: boolean\n frames: StackFrame[]\n clientStats: () => webpack.Stats | null\n serverStats: () => webpack.Stats | null\n edgeServerStats: () => webpack.Stats | null\n rootDirectory: string\n}): Promise<OriginalStackFramesResponse> {\n return Promise.all(\n frames.map(\n (frame): Promise<OriginalStackFramesResponse[number]> =>\n getOriginalStackFrame({\n isServer,\n isEdgeServer,\n isAppDirectory,\n frame,\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n }).then(\n (value) => {\n return {\n status: 'fulfilled',\n value,\n }\n },\n (reason) => {\n return {\n status: 'rejected',\n reason: inspect(reason, { colors: false }),\n }\n }\n )\n )\n )\n}\n\nasync function getOriginalStackFrame({\n isServer,\n isEdgeServer,\n isAppDirectory,\n frame,\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n}: {\n isServer: boolean\n isEdgeServer: boolean\n isAppDirectory: boolean\n frame: StackFrame\n clientStats: () => webpack.Stats | null\n serverStats: () => webpack.Stats | null\n edgeServerStats: () => webpack.Stats | null\n rootDirectory: string\n}): Promise<OriginalStackFrameResponse> {\n const filename = frame.file ?? ''\n const source = await getSource(filename, {\n getCompilations: () => {\n const compilations: webpack.Compilation[] = []\n\n // Try Client Compilation first. In `pages` we leverage\n // `isClientError` to check. In `app` it depends on if it's a server\n // / client component and when the code throws. E.g. during HTML\n // rendering it's the server/edge compilation.\n if ((!isEdgeServer && !isServer) || isAppDirectory) {\n const compilation = clientStats()?.compilation\n\n if (compilation) {\n compilations.push(compilation)\n }\n }\n\n // Try Server Compilation. In `pages` this could be something\n // imported in getServerSideProps/getStaticProps as the code for\n // those is tree-shaken. In `app` this finds server components and\n // code that was imported from a server component. It also covers\n // when client component code throws during HTML rendering.\n if (isServer || isAppDirectory) {\n const compilation = serverStats()?.compilation\n\n if (compilation) {\n compilations.push(compilation)\n }\n }\n\n // Try Edge Server Compilation. Both cases are the same as Server\n // Compilation, main difference is that it covers `runtime: 'edge'`\n // pages/app routes.\n if (isEdgeServer || isAppDirectory) {\n const compilation = edgeServerStats()?.compilation\n\n if (compilation) {\n compilations.push(compilation)\n }\n }\n\n return compilations\n },\n })\n\n // This stack frame is used for the one that couldn't locate the source or source mapped frame\n const defaultStackFrame: IgnorableStackFrame = {\n file: frame.file,\n lineNumber: frame.lineNumber,\n column: frame.column ?? 1,\n methodName: frame.methodName,\n ignored: shouldIgnoreSource(filename),\n arguments: [],\n }\n if (!source) {\n // return original stack frame with no source map\n return {\n originalStackFrame: defaultStackFrame,\n originalCodeFrame: null,\n }\n }\n\n const originalStackFrameResponse = await createOriginalStackFrame({\n frame,\n source,\n rootDirectory,\n })\n\n if (!originalStackFrameResponse) {\n return {\n originalStackFrame: defaultStackFrame,\n originalCodeFrame: null,\n }\n }\n\n return originalStackFrameResponse\n}\n\nexport function getOverlayMiddleware(options: {\n rootDirectory: string\n clientStats: () => webpack.Stats | null\n serverStats: () => webpack.Stats | null\n edgeServerStats: () => webpack.Stats | null\n}) {\n const { rootDirectory, clientStats, serverStats, edgeServerStats } = options\n\n return async function (\n req: IncomingMessage,\n res: ServerResponse,\n next: () => void\n ): Promise<void> {\n const { pathname, searchParams } = new URL(`http://n${req.url}`)\n\n if (pathname === '/__nextjs_original-stack-frames') {\n if (req.method !== 'POST') {\n return badRequest(res)\n }\n\n const body = await new Promise<string>((resolve, reject) => {\n let data = ''\n req.on('data', (chunk) => {\n data += chunk\n })\n req.on('end', () => resolve(data))\n req.on('error', reject)\n })\n\n try {\n const { frames, isServer, isEdgeServer, isAppDirectory } = JSON.parse(\n body\n ) as OriginalStackFramesRequest\n\n return json(\n res,\n await getOriginalStackFrames({\n isServer,\n isEdgeServer,\n isAppDirectory,\n frames: frames.map((frame) => ({\n ...frame,\n lineNumber: frame.lineNumber ?? 0,\n column: frame.column ?? 0,\n })),\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n })\n )\n } catch (err) {\n return badRequest(res)\n }\n } else if (pathname === '/__nextjs_launch-editor') {\n const frame = {\n file: searchParams.get('file') as string,\n methodName: searchParams.get('methodName') as string,\n lineNumber: parseInt(searchParams.get('lineNumber') ?? '0', 10) || 0,\n column: parseInt(searchParams.get('column') ?? '0', 10) || 0,\n arguments: searchParams.getAll('arguments').filter(Boolean),\n } satisfies StackFrame\n\n if (!frame.file) return badRequest(res)\n\n // frame files may start with their webpack layer, like (middleware)/middleware.js\n const filePath = path.resolve(\n rootDirectory,\n frame.file.replace(/^\\([^)]+\\)\\//, '')\n )\n const fileExists = await fs.access(filePath, FS.F_OK).then(\n () => true,\n () => false\n )\n if (!fileExists) return notFound(res)\n\n try {\n launchEditor(filePath, frame.lineNumber, frame.column ?? 1)\n } catch (err) {\n console.log('Failed to launch editor:', err)\n return internalServerError(res)\n }\n\n return noContent(res)\n }\n\n return next()\n }\n}\n\nexport function getSourceMapMiddleware(options: {\n clientStats: () => webpack.Stats | null\n serverStats: () => webpack.Stats | null\n edgeServerStats: () => webpack.Stats | null\n}) {\n const { clientStats, serverStats, edgeServerStats } = options\n\n return async function (\n req: IncomingMessage,\n res: ServerResponse,\n next: () => void\n ): Promise<void> {\n const { pathname, searchParams } = new URL(`http://n${req.url}`)\n\n if (pathname !== '/__nextjs_source-map') {\n return next()\n }\n\n const filename = searchParams.get('filename')\n\n if (!filename) {\n return badRequest(res)\n }\n\n let source: Source | undefined\n\n try {\n source = await getSource(filename, {\n getCompilations: () => {\n const compilations: webpack.Compilation[] = []\n\n for (const stats of [\n clientStats(),\n serverStats(),\n edgeServerStats(),\n ]) {\n if (stats?.compilation) {\n compilations.push(stats.compilation)\n }\n }\n\n return compilations\n },\n })\n } catch (error) {\n return internalServerError(res, error)\n }\n\n if (!source) {\n return noContent(res)\n }\n\n return json(res, source.sourceMap)\n }\n}\n"],"names":["constants","FS","promises","fs","findSourceMap","path","fileURLToPath","pathToFileURL","SourceMapConsumer","getSourceMapFromFile","launchEditor","badRequest","getOriginalCodeFrame","internalServerError","json","noContent","notFound","getServerError","parseStack","formatFrameSourceFile","inspect","shouldIgnoreSource","sourceURL","includes","startsWith","getModuleById","id","compilation","chunkGraph","modules","find","module","getModuleId","findModuleNotFoundFromError","errorMessage","match","getSourcePath","source","replace","findOriginalSourcePositionAndContent","sourceMap","position","consumer","cause","Error","file","sourcePosition","originalPositionFor","line","lineNumber","column","sourceContent","sourceContentFor","destroy","getIgnoredSources","ignoreList","Set","moduleFilenames","sources","index","length","webpackSourceURL","formattedFilePath","add","ignoredSources","map","url","ignored","has","indexOf","content","sourcesContent","isIgnoredSource","ignoredSource","findOriginalSourcePositionAndContentFromCompilation","moduleId","importedModule","buildInfo","importLocByPath","get","createOriginalStackFrame","rootDirectory","frame","moduleNotFound","result","type","undefined","moduleURL","sourcePath","filePath","resolve","resolvedFilePath","relative","traced","methodName","arguments","originalStackFrame","originalCodeFrame","getSourceMapFromCompilation","codeGenerationResult","codeGenerationResults","err","console","error","getSource","options","getCompilations","nativeSourceMap","sourceMapPayload","payload","isAbsolute","href","getOriginalStackFrames","isServer","isEdgeServer","isAppDirectory","frames","clientStats","serverStats","edgeServerStats","Promise","all","getOriginalStackFrame","then","value","status","reason","colors","filename","compilations","push","defaultStackFrame","originalStackFrameResponse","getOverlayMiddleware","req","res","next","pathname","searchParams","URL","method","body","reject","data","on","chunk","JSON","parse","parseInt","getAll","filter","Boolean","fileExists","access","F_OK","log","getSourceMapMiddleware","stats"],"mappings":"AAAA,SAASA,aAAaC,EAAE,EAAEC,YAAYC,EAAE,QAAQ,KAAI;AACpD,SAASC,aAAa,QAAwB,SAAQ;AACtD,OAAOC,UAAU,OAAM;AACvB,SAASC,aAAa,EAAEC,aAAa,QAAQ,MAAK;AAClD,SACEC,iBAAiB,QAEZ,kCAAiC;AAExC,SAASC,oBAAoB,QAAQ,+CAA8C;AACnF,SAASC,YAAY,QAAQ,mCAAkC;AAC/D,SACEC,UAAU,EACVC,oBAAoB,EACpBC,mBAAmB,EACnBC,IAAI,EACJC,SAAS,EACTC,QAAQ,QAIH,WAAU;AACjB,SAASC,cAAc,QAAQ,wCAAuC;AACtE,SAASC,UAAU,QAAQ,kCAAiC;AAC5D,SAAST,oBAAoB,GAAE;AAQ/B,SAASU,qBAAqB,QAAQ,0CAAyC;AAE/E,SAASC,OAAO,QAAQ,OAAM;AAE9B,SAASC,mBAAmBC,SAAiB;IAC3C,OACEA,UAAUC,QAA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EC,eAAe,EAAE,GAAGd;IAEtD,OAAO,eACL6B,GAAoB,EACpBC,GAAmB,EACnBC,IAAgB;QAEhB,MAAM,EAAEC,QAAQ,EAAEC,YAAY,EAAE,GAAG,IAAIC,IAAI,AAAC,aAAUL,IAAIpE,GAAG;QAE7D,IAAIuE,aAAa,wBAAwB;YACvC,OAAOD;QACT;QAEA,MAAMR,WAAWU,aAAa3D,GAAG,CAAC;QAElC,IAAI,CAACiD,UAAU;YACb,OAAOrH,WAAW4H;QACpB;QAEA,IAAIlG;QAEJ,IAAI;YACFA,SAAS,MAAMmE,UAAUwB,UAAU;gBACjCtB,iBAAiB;oBACf,MAAMuB,eAAsC,EAAE;oBAE9C,KAAK,MAAM4B,SAAS;wBAClBxC;wBACAC;wBACAC;qBACD,CAAE;wBACD,IAAIsC,yBAAAA,MAAOlI,WAAW,EAAE;4BACtBsG,aAAaC,IAAI,CAAC2B,MAAMlI,WAAW;wBACrC;oBACF;oBAEA,OAAOsG;gBACT;YACF;QACF,EAAE,OAAO1B,OAAO;YACd,OAAO1F,oBAAoB0H,KAAKhC;QAClC;QAEA,IAAI,CAAClE,QAAQ;YACX,OAAOtB,UAAUwH;QACnB;QAEA,OAAOzH,KAAKyH,KAAKlG,OAAOG,SAAS;IACnC;AACF"}
1
+ {"version":3,"sources":["../../../../../src/client/components/react-dev-overlay/server/middleware-webpack.ts"],"sourcesContent":["import { constants as FS, promises as fs } from 'fs'\nimport { findSourceMap, type SourceMap } from 'module'\nimport path from 'path'\nimport { fileURLToPath, pathToFileURL } from 'url'\nimport {\n SourceMapConsumer,\n type BasicSourceMapConsumer,\n} from 'next/dist/compiled/source-map08'\nimport type { StackFrame } from 'next/dist/compiled/stacktrace-parser'\nimport { getSourceMapFromFile } from '../internal/helpers/get-source-map-from-file'\nimport { launchEditor } from '../internal/helpers/launchEditor'\nimport {\n getOriginalCodeFrame,\n type OriginalStackFrameResponse,\n type OriginalStackFramesRequest,\n type OriginalStackFramesResponse,\n} from './shared'\nimport { middlewareResponse } from './middleware-response'\nexport { getServerError } from '../internal/helpers/node-stack-frames'\nexport { parseStack } from '../internal/helpers/parse-stack'\nexport { getSourceMapFromFile }\n\nimport type { IncomingMessage, ServerResponse } from 'http'\nimport type webpack from 'webpack'\nimport type {\n NullableMappedPosition,\n RawSourceMap,\n} from 'next/dist/compiled/source-map08'\nimport { formatFrameSourceFile } from '../internal/helpers/webpack-module-path'\nimport type { MappedPosition } from 'source-map'\nimport { inspect } from 'util'\n\nfunction shouldIgnoreSource(sourceURL: string): boolean {\n return (\n sourceURL.includes('node_modules') ||\n // Only relevant for when Next.js is symlinked e.g. in the Next.js monorepo\n sourceURL.includes('next/dist') ||\n sourceURL.startsWith('node:')\n )\n}\n\ntype IgnoredSources = Array<{ url: string; ignored: boolean }>\n\nexport interface IgnorableStackFrame extends StackFrame {\n ignored: boolean\n}\n\ntype SourceAttributes = {\n sourcePosition: NullableMappedPosition\n sourceContent: string | null\n}\n\ntype Source =\n | {\n type: 'file'\n sourceMap: RawSourceMap\n ignoredSources: IgnoredSources\n moduleURL: string\n }\n | {\n type: 'bundle'\n sourceMap: RawSourceMap\n ignoredSources: IgnoredSources\n compilation: webpack.Compilation\n moduleId: string\n moduleURL: string\n }\n\nfunction getModuleById(\n id: string | undefined,\n compilation: webpack.Compilation\n) {\n const { chunkGraph, modules } = compilation\n\n return [...modules].find((module) => chunkGraph.getModuleId(module) === id)\n}\n\nfunction findModuleNotFoundFromError(errorMessage: string | undefined) {\n return errorMessage?.match(/'([^']+)' module/)?.[1]\n}\n\nfunction getSourcePath(source: string) {\n if (source.startsWith('file://')) {\n return fileURLToPath(source)\n }\n return source.replace(/^(webpack:\\/\\/\\/|webpack:\\/\\/|webpack:\\/\\/_N_E\\/)/, '')\n}\n\n/**\n * @returns 1-based lines and 0-based columns\n */\nasync function findOriginalSourcePositionAndContent(\n sourceMap: RawSourceMap,\n position: { lineNumber: number | null; column: number | null }\n): Promise<SourceAttributes | null> {\n let consumer: BasicSourceMapConsumer\n try {\n consumer = await new SourceMapConsumer(sourceMap)\n } catch (cause) {\n throw new Error(\n `${sourceMap.file}: Invalid source map. Only conformant source maps can be used to find the original code.`,\n { cause }\n )\n }\n\n try {\n const sourcePosition = consumer.originalPositionFor({\n line: position.lineNumber ?? 1,\n // 0-based columns out requires 0-based columns in.\n column: (position.column ?? 1) - 1,\n })\n\n if (!sourcePosition.source) {\n return null\n }\n\n const sourceContent: string | null =\n consumer.sourceContentFor(\n sourcePosition.source,\n /* returnNullOnMissing */ true\n ) ?? null\n\n return {\n sourcePosition,\n sourceContent,\n }\n } finally {\n consumer.destroy()\n }\n}\n\nexport function getIgnoredSources(\n sourceMap: RawSourceMap & { ignoreList?: number[] }\n): IgnoredSources {\n const ignoreList = new Set<number>(sourceMap.ignoreList ?? [])\n const moduleFilenames = sourceMap?.sources ?? []\n\n for (let index = 0; index < moduleFilenames.length; index++) {\n // bundlerFilePath case: webpack://./app/page.tsx\n const webpackSourceURL = moduleFilenames[index]\n // Format the path to the normal file path\n const formattedFilePath = formatFrameSourceFile(webpackSourceURL)\n if (shouldIgnoreSource(formattedFilePath)) {\n ignoreList.add(index)\n }\n }\n\n const ignoredSources = sourceMap.sources.map((source, index) => {\n return {\n url: source,\n ignored: ignoreList.has(sourceMap.sources.indexOf(source)),\n content: sourceMap.sourcesContent?.[index] ?? null,\n }\n })\n return ignoredSources\n}\n\nfunction isIgnoredSource(\n source: Source,\n sourcePosition: MappedPosition | NullableMappedPosition\n) {\n if (sourcePosition.source == null) {\n return true\n }\n for (const ignoredSource of source.ignoredSources) {\n if (ignoredSource.ignored && ignoredSource.url === sourcePosition.source) {\n return true\n }\n }\n\n return false\n}\n\nfunction findOriginalSourcePositionAndContentFromCompilation(\n moduleId: string | undefined,\n importedModule: string,\n compilation: webpack.Compilation\n): SourceAttributes | null {\n const module = getModuleById(moduleId, compilation)\n return module?.buildInfo?.importLocByPath?.get(importedModule) ?? null\n}\n\nexport async function createOriginalStackFrame({\n source,\n rootDirectory,\n frame,\n errorMessage,\n}: {\n source: Source\n rootDirectory: string\n frame: StackFrame\n errorMessage?: string\n}): Promise<OriginalStackFrameResponse | null> {\n const moduleNotFound = findModuleNotFoundFromError(errorMessage)\n const result = await (() => {\n if (moduleNotFound) {\n if (source.type === 'file') {\n return undefined\n }\n\n return findOriginalSourcePositionAndContentFromCompilation(\n source.moduleId,\n moduleNotFound,\n source.compilation\n )\n }\n return findOriginalSourcePositionAndContent(source.sourceMap, frame)\n })()\n\n if (!result) {\n return null\n }\n const { sourcePosition, sourceContent } = result\n\n if (!sourcePosition.source) {\n return null\n }\n\n const ignored =\n isIgnoredSource(source, sourcePosition) ||\n // If the source file is externals, should be excluded even it's not ignored source.\n // e.g. webpack://next/dist/.. needs to be ignored\n shouldIgnoreSource(source.moduleURL)\n\n const sourcePath = getSourcePath(\n // When sourcePosition.source is the loader path the modulePath is generally better.\n (sourcePosition.source!.includes('|')\n ? source.moduleURL\n : sourcePosition.source) || source.moduleURL\n )\n const filePath = path.resolve(rootDirectory, sourcePath)\n const resolvedFilePath = path.relative(rootDirectory, filePath)\n\n const traced: IgnorableStackFrame = {\n file: resolvedFilePath,\n lineNumber: sourcePosition.line,\n column: (sourcePosition.column ?? 0) + 1,\n methodName:\n // We ignore the sourcemapped name since it won't be the correct name.\n // The callsite will point to the column of the variable name instead of the\n // name of the enclosing function.\n // TODO(NDX-531): Spy on prepareStackTrace to get the enclosing line number for method name mapping.\n // default is not a valid identifier in JS so webpack uses a custom variable when it's an unnamed default export\n // Resolve it back to `default` for the method name if the source position didn't have the method.\n frame.methodName\n ?.replace('__WEBPACK_DEFAULT_EXPORT__', 'default')\n ?.replace('__webpack_exports__.', ''),\n arguments: [],\n ignored,\n }\n\n return {\n originalStackFrame: traced,\n originalCodeFrame: getOriginalCodeFrame(traced, sourceContent),\n }\n}\n\nasync function getSourceMapFromCompilation(\n id: string,\n compilation: webpack.Compilation\n): Promise<RawSourceMap | undefined> {\n try {\n const module = getModuleById(id, compilation)\n\n if (!module) {\n return undefined\n }\n\n // @ts-expect-error The types for `CodeGenerationResults.get` require a\n // runtime to be passed as second argument, but apparently it also works\n // without it.\n const codeGenerationResult = compilation.codeGenerationResults.get(module)\n const source = codeGenerationResult?.sources.get('javascript')\n\n return source?.map() ?? undefined\n } catch (err) {\n console.error(`Failed to lookup module by ID (\"${id}\"):`, err)\n return undefined\n }\n}\n\nasync function getSource(\n sourceURL: string,\n options: {\n getCompilations: () => webpack.Compilation[]\n }\n): Promise<Source | undefined> {\n const { getCompilations } = options\n\n let nativeSourceMap: SourceMap | undefined\n try {\n nativeSourceMap = findSourceMap(sourceURL)\n } catch (cause) {\n throw new Error(\n `${sourceURL}: Invalid source map. Only conformant source maps can be used to find the original code.`,\n { cause }\n )\n }\n\n if (nativeSourceMap !== undefined) {\n const sourceMapPayload = nativeSourceMap.payload\n return {\n type: 'file',\n sourceMap: sourceMapPayload,\n ignoredSources: getIgnoredSources(sourceMapPayload),\n moduleURL: sourceURL,\n }\n }\n\n if (path.isAbsolute(sourceURL)) {\n sourceURL = pathToFileURL(sourceURL).href\n }\n\n if (sourceURL.startsWith('file:')) {\n const sourceMap = await getSourceMapFromFile(sourceURL)\n return sourceMap\n ? {\n type: 'file',\n sourceMap,\n ignoredSources: getIgnoredSources(sourceMap),\n moduleURL: sourceURL,\n }\n : undefined\n }\n\n // webpack-internal:///./src/hello.tsx => ./src/hello.tsx\n // rsc://React/Server/webpack-internal:///(rsc)/./src/hello.tsx?42 => (rsc)/./src/hello.tsx\n // webpack://_N_E/./src/hello.tsx => ./src/hello.tsx\n const moduleId = sourceURL\n .replace(\n /^(rsc:\\/\\/React\\/[^/]+\\/)?(webpack-internal:\\/\\/\\/|webpack:\\/\\/(_N_E\\/)?)/,\n ''\n )\n .replace(/\\?\\d+$/, '')\n\n // (rsc)/./src/hello.tsx => ./src/hello.tsx\n const moduleURL = moduleId.replace(/^(\\(.*\\)\\/?)/, '')\n\n for (const compilation of getCompilations()) {\n const sourceMap = await getSourceMapFromCompilation(moduleId, compilation)\n\n if (sourceMap) {\n const ignoredSources = getIgnoredSources(sourceMap)\n return {\n type: 'bundle',\n sourceMap,\n compilation,\n moduleId,\n moduleURL,\n ignoredSources,\n }\n }\n }\n\n return undefined\n}\n\nfunction getOriginalStackFrames({\n isServer,\n isEdgeServer,\n isAppDirectory,\n frames,\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n}: {\n isServer: boolean\n isEdgeServer: boolean\n isAppDirectory: boolean\n frames: StackFrame[]\n clientStats: () => webpack.Stats | null\n serverStats: () => webpack.Stats | null\n edgeServerStats: () => webpack.Stats | null\n rootDirectory: string\n}): Promise<OriginalStackFramesResponse> {\n return Promise.all(\n frames.map(\n (frame): Promise<OriginalStackFramesResponse[number]> =>\n getOriginalStackFrame({\n isServer,\n isEdgeServer,\n isAppDirectory,\n frame,\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n }).then(\n (value) => {\n return {\n status: 'fulfilled',\n value,\n }\n },\n (reason) => {\n return {\n status: 'rejected',\n reason: inspect(reason, { colors: false }),\n }\n }\n )\n )\n )\n}\n\nasync function getOriginalStackFrame({\n isServer,\n isEdgeServer,\n isAppDirectory,\n frame,\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n}: {\n isServer: boolean\n isEdgeServer: boolean\n isAppDirectory: boolean\n frame: StackFrame\n clientStats: () => webpack.Stats | null\n serverStats: () => webpack.Stats | null\n edgeServerStats: () => webpack.Stats | null\n rootDirectory: string\n}): Promise<OriginalStackFrameResponse> {\n const filename = frame.file ?? ''\n const source = await getSource(filename, {\n getCompilations: () => {\n const compilations: webpack.Compilation[] = []\n\n // Try Client Compilation first. In `pages` we leverage\n // `isClientError` to check. In `app` it depends on if it's a server\n // / client component and when the code throws. E.g. during HTML\n // rendering it's the server/edge compilation.\n if ((!isEdgeServer && !isServer) || isAppDirectory) {\n const compilation = clientStats()?.compilation\n\n if (compilation) {\n compilations.push(compilation)\n }\n }\n\n // Try Server Compilation. In `pages` this could be something\n // imported in getServerSideProps/getStaticProps as the code for\n // those is tree-shaken. In `app` this finds server components and\n // code that was imported from a server component. It also covers\n // when client component code throws during HTML rendering.\n if (isServer || isAppDirectory) {\n const compilation = serverStats()?.compilation\n\n if (compilation) {\n compilations.push(compilation)\n }\n }\n\n // Try Edge Server Compilation. Both cases are the same as Server\n // Compilation, main difference is that it covers `runtime: 'edge'`\n // pages/app routes.\n if (isEdgeServer || isAppDirectory) {\n const compilation = edgeServerStats()?.compilation\n\n if (compilation) {\n compilations.push(compilation)\n }\n }\n\n return compilations\n },\n })\n\n // This stack frame is used for the one that couldn't locate the source or source mapped frame\n const defaultStackFrame: IgnorableStackFrame = {\n file: frame.file,\n lineNumber: frame.lineNumber,\n column: frame.column ?? 1,\n methodName: frame.methodName,\n ignored: shouldIgnoreSource(filename),\n arguments: [],\n }\n if (!source) {\n // return original stack frame with no source map\n return {\n originalStackFrame: defaultStackFrame,\n originalCodeFrame: null,\n }\n }\n\n const originalStackFrameResponse = await createOriginalStackFrame({\n frame,\n source,\n rootDirectory,\n })\n\n if (!originalStackFrameResponse) {\n return {\n originalStackFrame: defaultStackFrame,\n originalCodeFrame: null,\n }\n }\n\n return originalStackFrameResponse\n}\n\nexport function getOverlayMiddleware(options: {\n rootDirectory: string\n clientStats: () => webpack.Stats | null\n serverStats: () => webpack.Stats | null\n edgeServerStats: () => webpack.Stats | null\n}) {\n const { rootDirectory, clientStats, serverStats, edgeServerStats } = options\n\n return async function (\n req: IncomingMessage,\n res: ServerResponse,\n next: () => void\n ): Promise<void> {\n const { pathname, searchParams } = new URL(`http://n${req.url}`)\n\n if (pathname === '/__nextjs_original-stack-frames') {\n if (req.method !== 'POST') {\n return middlewareResponse.badRequest(res)\n }\n\n const body = await new Promise<string>((resolve, reject) => {\n let data = ''\n req.on('data', (chunk) => {\n data += chunk\n })\n req.on('end', () => resolve(data))\n req.on('error', reject)\n })\n\n try {\n const { frames, isServer, isEdgeServer, isAppDirectory } = JSON.parse(\n body\n ) as OriginalStackFramesRequest\n\n return middlewareResponse.json(\n res,\n await getOriginalStackFrames({\n isServer,\n isEdgeServer,\n isAppDirectory,\n frames: frames.map((frame) => ({\n ...frame,\n lineNumber: frame.lineNumber ?? 0,\n column: frame.column ?? 0,\n })),\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n })\n )\n } catch (err) {\n return middlewareResponse.badRequest(res)\n }\n } else if (pathname === '/__nextjs_launch-editor') {\n const frame = {\n file: searchParams.get('file') as string,\n methodName: searchParams.get('methodName') as string,\n lineNumber: parseInt(searchParams.get('lineNumber') ?? '0', 10) || 0,\n column: parseInt(searchParams.get('column') ?? '0', 10) || 0,\n arguments: searchParams.getAll('arguments').filter(Boolean),\n } satisfies StackFrame\n\n if (!frame.file) return middlewareResponse.badRequest(res)\n\n // frame files may start with their webpack layer, like (middleware)/middleware.js\n const filePath = path.resolve(\n rootDirectory,\n frame.file.replace(/^\\([^)]+\\)\\//, '')\n )\n const fileExists = await fs.access(filePath, FS.F_OK).then(\n () => true,\n () => false\n )\n if (!fileExists) return middlewareResponse.notFound(res)\n\n try {\n launchEditor(filePath, frame.lineNumber, frame.column ?? 1)\n } catch (err) {\n console.log('Failed to launch editor:', err)\n return middlewareResponse.internalServerError(res)\n }\n\n return middlewareResponse.noContent(res)\n }\n\n return next()\n }\n}\n\nexport function getSourceMapMiddleware(options: {\n clientStats: () => webpack.Stats | null\n serverStats: () => webpack.Stats | null\n edgeServerStats: () => webpack.Stats | null\n}) {\n const { clientStats, serverStats, edgeServerStats } = options\n\n return async function (\n req: IncomingMessage,\n res: ServerResponse,\n next: () => void\n ): Promise<void> {\n const { pathname, searchParams } = new URL(`http://n${req.url}`)\n\n if (pathname !== '/__nextjs_source-map') {\n return next()\n }\n\n const filename = searchParams.get('filename')\n\n if (!filename) {\n return middlewareResponse.badRequest(res)\n }\n\n let source: Source | undefined\n\n try {\n source = await getSource(filename, {\n getCompilations: () => {\n const compilations: webpack.Compilation[] = []\n\n for (const stats of [\n clientStats(),\n serverStats(),\n edgeServerStats(),\n ]) {\n if (stats?.compilation) {\n compilations.push(stats.compilation)\n }\n }\n\n return compilations\n },\n })\n } catch (error) {\n return middlewareResponse.internalServerError(res, error)\n }\n\n if (!source) {\n return middlewareResponse.noContent(res)\n }\n\n return middlewareResponse.json(res, source.sourceMap)\n }\n}\n"],"names":["constants","FS","promises","fs","findSourceMap","path","fileURLToPath","pathToFileURL","SourceMapConsumer","getSourceMapFromFile","launchEditor","getOriginalCodeFrame","middlewareResponse","getServerError","parseStack","formatFrameSourceFile","inspect","shouldIgnoreSource","sourceURL","includes","startsWith","getModuleById","id","compilation","chunkGraph","modules","find","module","getModuleId","findModuleNotFoundFromError","errorMessage","match","getSourcePath","source","replace","findOriginalSourcePositionAndContent","sourceMap","position","consumer","cause","Error","file","sourcePosition","originalPositionFor","line","lineNumber","column","sourceContent","sourceContentFor","destroy","getIgnoredSources","ignoreList","Set","moduleFilenames","sources","index","length","webpackSourceURL","formattedFilePath","add","ignoredSources","map","url","ignored","has","indexOf","content","sourcesContent","isIgnoredSource","ignoredSource","findOriginalSourcePositionAndContentFromCompilation","moduleId","importedModule","buildInfo","importLocByPath","get","createOriginalStackFrame","rootDirectory","frame","moduleNotFound","result","type","undefined","moduleURL","sourcePath","filePath","resolve","resolvedFilePath","relative","traced","methodName","arguments","originalStackFrame","originalCodeFrame","getSourceMapFromCompilation","codeGenerationResult","codeGenerationResults","err","console","error","getSource","options","getCompilations","nativeSourceMap","sourceMapPayload","payload","isAbsolute","href","getOriginalStackFrames","isServer","isEdgeServer","isAppDirectory","frames","clientStats","serverStats","edgeServerStats","Promise","all","getOriginalStackFrame","then","value","status","reason","colors","filename","compilations","push","defaultStackFrame","originalStackFrameResponse","getOverlayMiddleware","req","res","next","pathname","searchParams","URL","method","badRequest","body","reject","data","on","chunk","JSON","parse","json","parseInt","getAll","filter","Boolean","fileExists","access","F_OK","notFound","log","internalServerError","noContent","getSourceMapMiddleware","stats"],"mappings":"AAAA,S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,CAACgC,MAAMvI,WAAW;wBACrC;oBACF;oBAEA,OAAOsG;gBACT;YACF;QACF,EAAE,OAAO1B,OAAO;YACd,OAAOvF,mBAAmB+I,mBAAmB,CAACxB,KAAKhC;QACrD;QAEA,IAAI,CAAClE,QAAQ;YACX,OAAOrB,mBAAmBgJ,SAAS,CAACzB;QACtC;QAEA,OAAOvH,mBAAmBqI,IAAI,CAACd,KAAKlG,OAAOG,SAAS;IACtD;AACF"}
@@ -1,4 +1,3 @@
1
- import { inspect } from 'util';
2
1
  import { codeFrameColumns } from 'next/dist/compiled/babel/code-frame';
3
2
  import isInternal, { nextInternalsRe, reactNodeModulesRe, reactVendoredRe } from '../../../../shared/lib/is-internal';
4
3
  const nextMethodRe = /(^__webpack_.*|node_modules[\\/]next[\\/])/;
@@ -40,30 +39,5 @@ const nextMethodRe = /(^__webpack_.*|node_modules[\\/]next[\\/])/;
40
39
  forceColor: colors
41
40
  });
42
41
  }
43
- export function noContent(res) {
44
- res.statusCode = 204;
45
- res.end('No Content');
46
- }
47
- export function badRequest(res) {
48
- res.statusCode = 400;
49
- res.end('Bad Request');
50
- }
51
- export function notFound(res) {
52
- res.statusCode = 404;
53
- res.end('Not Found');
54
- }
55
- export function internalServerError(res, error) {
56
- res.statusCode = 500;
57
- res.setHeader('Content-Type', 'text/plain');
58
- res.end(error !== undefined ? inspect(error, {
59
- colors: false
60
- }) : 'Internal Server Error');
61
- }
62
- export function json(res, data) {
63
- res.setHeader('Content-Type', 'application/json').end(Buffer.from(JSON.stringify(data)));
64
- }
65
- export function jsonString(res, data) {
66
- res.setHeader('Content-Type', 'application/json').end(Buffer.from(data));
67
- }
68
42
 
69
43
  //# sourceMappingURL=shared.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/client/components/react-dev-overlay/server/shared.ts"],"sourcesContent":["import type { StackFrame } from 'stacktrace-parser'\nimport type { ServerResponse } from 'http'\nimport { inspect } from 'util'\nimport { codeFrameColumns } from 'next/dist/compiled/babel/code-frame'\nimport isInternal, {\n nextInternalsRe,\n reactNodeModulesRe,\n reactVendoredRe,\n} from '../../../../shared/lib/is-internal'\n\nexport type SourcePackage = 'react' | 'next'\n\nexport interface OriginalStackFramesRequest {\n frames: StackFrame[]\n isServer: boolean\n isEdgeServer: boolean\n isAppDirectory: boolean\n}\n\nexport type OriginalStackFramesResponse = OriginalStackFrameResponseResult[]\n\nexport type OriginalStackFrameResponseResult =\n PromiseSettledResult<OriginalStackFrameResponse>\n\nexport interface OriginalStackFrameResponse {\n originalStackFrame?: (StackFrame & { ignored: boolean }) | null\n originalCodeFrame?: string | null\n /** We use this to group frames in the error overlay */\n sourcePackage?: SourcePackage | null\n}\n\nconst nextMethodRe = /(^__webpack_.*|node_modules[\\\\/]next[\\\\/])/\n\n/** Given a frame, it parses which package it belongs to. */\nexport function findSourcePackage({\n file,\n methodName,\n}: Partial<{ file: string | null; methodName: string | null }>):\n | SourcePackage\n | undefined {\n if (file) {\n // matching React first since vendored would match under `next` too\n if (reactVendoredRe.test(file) || reactNodeModulesRe.test(file)) {\n return 'react'\n } else if (nextInternalsRe.test(file)) {\n return 'next'\n } else if (file.startsWith('[turbopack]/')) {\n return 'next'\n }\n }\n\n if (methodName) {\n if (nextMethodRe.test(methodName)) {\n return 'next'\n }\n }\n}\n\n/**\n * It looks up the code frame of the traced source.\n * @note It ignores Next.js/React internals, as these can often be huge bundled files.\n */\nexport function getOriginalCodeFrame(\n frame: StackFrame,\n source: string | null,\n colors: boolean = process.stdout.isTTY\n): string | null {\n if (!source || isInternal(frame.file)) {\n return null\n }\n\n return codeFrameColumns(\n source,\n {\n start: {\n // 1-based, but -1 means start line without highlighting\n line: frame.lineNumber ?? -1,\n // 1-based, but 0 means whole line without column highlighting\n column: frame.column ?? 0,\n },\n },\n { forceColor: colors }\n )\n}\n\nexport function noContent(res: ServerResponse) {\n res.statusCode = 204\n res.end('No Content')\n}\n\nexport function badRequest(res: ServerResponse) {\n res.statusCode = 400\n res.end('Bad Request')\n}\n\nexport function notFound(res: ServerResponse) {\n res.statusCode = 404\n res.end('Not Found')\n}\n\nexport function internalServerError(res: ServerResponse, error?: unknown) {\n res.statusCode = 500\n res.setHeader('Content-Type', 'text/plain')\n res.end(\n error !== undefined\n ? inspect(error, { colors: false })\n : 'Internal Server Error'\n )\n}\n\nexport function json(res: ServerResponse, data: any) {\n res\n .setHeader('Content-Type', 'application/json')\n .end(Buffer.from(JSON.stringify(data)))\n}\n\nexport function jsonString(res: ServerResponse, data: string) {\n res.setHeader('Content-Type', 'application/json').end(Buffer.from(data))\n}\n"],"names":["inspect","codeFrameColumns","isInternal","nextInternalsRe","reactNodeModulesRe","reactVendoredRe","nextMethodRe","findSourcePackage","file","methodName","test","startsWith","getOriginalCodeFrame","frame","source","colors","process","stdout","isTTY","start","line","lineNumber","column","forceColor","noContent","res","statusCode","end","badRequest","notFound","internalServerError","error","setHeader","undefined","json","data","Buffer","from","JSON","stringify","jsonString"],"mappings":"AAEA,SAASA,OAAO,QAAQ,OAAM;AAC9B,SAASC,gBAAgB,QAAQ,sCAAqC;AACtE,OAAOC,cACLC,eAAe,EACfC,kBAAkB,EAClBC,eAAe,QACV,qCAAoC;AAuB3C,MAAMC,eAAe;AAErB,0DAA0D,GAC1D,OAAO,SAASC,kBAAkB,KAG4B;IAH5B,IAAA,EAChCC,IAAI,EACJC,UAAU,EACkD,GAH5B;IAMhC,IAAID,MAAM;QACR,mEAAmE;QACnE,IAAIH,gBAAgBK,IAAI,CAACF,SAASJ,mBAAmBM,IAAI,CAACF,OAAO;YAC/D,OAAO;QACT,OAAO,IAAIL,gBAAgBO,IAAI,CAACF,OAAO;YACrC,OAAO;QACT,OAAO,IAAIA,KAAKG,UAAU,CAAC,iBAAiB;YAC1C,OAAO;QACT;IACF;IAEA,IAAIF,YAAY;QACd,IAAIH,aAAaI,IAAI,CAACD,aAAa;YACjC,OAAO;QACT;IACF;AACF;AAEA;;;CAGC,GACD,OAAO,SAASG,qBACdC,KAAiB,EACjBC,MAAqB,EACrBC,MAAsC;IAAtCA,IAAAA,mBAAAA,SAAkBC,QAAQC,MAAM,CAACC,KAAK;IAEtC,IAAI,CAACJ,UAAUZ,WAAWW,MAAML,IAAI,GAAG;QACrC,OAAO;IACT;QAOYK,mBAEEA;IAPd,OAAOZ,iBACLa,QACA;QACEK,OAAO;YACL,wDAAwD;YACxDC,MAAMP,CAAAA,oBAAAA,MAAMQ,UAAU,YAAhBR,oBAAoB,CAAC;YAC3B,8DAA8D;YAC9DS,QAAQT,CAAAA,gBAAAA,MAAMS,MAAM,YAAZT,gBAAgB;QAC1B;IACF,GACA;QAAEU,YAAYR;IAAO;AAEzB;AAEA,OAAO,SAASS,UAAUC,GAAmB;IAC3CA,IAAIC,UAAU,GAAG;IACjBD,IAAIE,GAAG,CAAC;AACV;AAEA,OAAO,SAASC,WAAWH,GAAmB;IAC5CA,IAAIC,UAAU,GAAG;IACjBD,IAAIE,GAAG,CAAC;AACV;AAEA,OAAO,SAASE,SAASJ,GAAmB;IAC1CA,IAAIC,UAAU,GAAG;IACjBD,IAAIE,GAAG,CAAC;AACV;AAEA,OAAO,SAASG,oBAAoBL,GAAmB,EAAEM,KAAe;IACtEN,IAAIC,UAAU,GAAG;IACjBD,IAAIO,SAAS,CAAC,gBAAgB;IAC9BP,IAAIE,GAAG,CACLI,UAAUE,YACNjC,QAAQ+B,OAAO;QAAEhB,QAAQ;IAAM,KAC/B;AAER;AAEA,OAAO,SAASmB,KAAKT,GAAmB,EAAEU,IAAS;IACjDV,IACGO,SAAS,CAAC,gBAAgB,oBAC1BL,GAAG,CAACS,OAAOC,IAAI,CAACC,KAAKC,SAAS,CAACJ;AACpC;AAEA,OAAO,SAASK,WAAWf,GAAmB,EAAEU,IAAY;IAC1DV,IAAIO,SAAS,CAAC,gBAAgB,oBAAoBL,GAAG,CAACS,OAAOC,IAAI,CAACF;AACpE"}
1
+ {"version":3,"sources":["../../../../../src/client/components/react-dev-overlay/server/shared.ts"],"sourcesContent":["import type { StackFrame } from 'stacktrace-parser'\nimport { codeFrameColumns } from 'next/dist/compiled/babel/code-frame'\nimport isInternal, {\n nextInternalsRe,\n reactNodeModulesRe,\n reactVendoredRe,\n} from '../../../../shared/lib/is-internal'\n\nexport type SourcePackage = 'react' | 'next'\n\nexport interface OriginalStackFramesRequest {\n frames: StackFrame[]\n isServer: boolean\n isEdgeServer: boolean\n isAppDirectory: boolean\n}\n\nexport type OriginalStackFramesResponse = OriginalStackFrameResponseResult[]\n\nexport type OriginalStackFrameResponseResult =\n PromiseSettledResult<OriginalStackFrameResponse>\n\nexport interface OriginalStackFrameResponse {\n originalStackFrame?: (StackFrame & { ignored: boolean }) | null\n originalCodeFrame?: string | null\n /** We use this to group frames in the error overlay */\n sourcePackage?: SourcePackage | null\n}\n\nconst nextMethodRe = /(^__webpack_.*|node_modules[\\\\/]next[\\\\/])/\n\n/** Given a frame, it parses which package it belongs to. */\nexport function findSourcePackage({\n file,\n methodName,\n}: Partial<{ file: string | null; methodName: string | null }>):\n | SourcePackage\n | undefined {\n if (file) {\n // matching React first since vendored would match under `next` too\n if (reactVendoredRe.test(file) || reactNodeModulesRe.test(file)) {\n return 'react'\n } else if (nextInternalsRe.test(file)) {\n return 'next'\n } else if (file.startsWith('[turbopack]/')) {\n return 'next'\n }\n }\n\n if (methodName) {\n if (nextMethodRe.test(methodName)) {\n return 'next'\n }\n }\n}\n\n/**\n * It looks up the code frame of the traced source.\n * @note It ignores Next.js/React internals, as these can often be huge bundled files.\n */\nexport function getOriginalCodeFrame(\n frame: StackFrame,\n source: string | null,\n colors: boolean = process.stdout.isTTY\n): string | null {\n if (!source || isInternal(frame.file)) {\n return null\n }\n\n return codeFrameColumns(\n source,\n {\n start: {\n // 1-based, but -1 means start line without highlighting\n line: frame.lineNumber ?? -1,\n // 1-based, but 0 means whole line without column highlighting\n column: frame.column ?? 0,\n },\n },\n { forceColor: colors }\n )\n}\n"],"names":["codeFrameColumns","isInternal","nextInternalsRe","reactNodeModulesRe","reactVendoredRe","nextMethodRe","findSourcePackage","file","methodName","test","startsWith","getOriginalCodeFrame","frame","source","colors","process","stdout","isTTY","start","line","lineNumber","column","forceColor"],"mappings":"AACA,SAASA,gBAAgB,QAAQ,sCAAqC;AACtE,OAAOC,cACLC,eAAe,EACfC,kBAAkB,EAClBC,eAAe,QACV,qCAAoC;AAuB3C,MAAMC,eAAe;AAErB,0DAA0D,GAC1D,OAAO,SAASC,kBAAkB,KAG4B;IAH5B,IAAA,EAChCC,IAAI,EACJC,UAAU,EACkD,GAH5B;IAMhC,IAAID,MAAM;QACR,mEAAmE;QACnE,IAAIH,gBAAgBK,IAAI,CAACF,SAASJ,mBAAmBM,IAAI,CAACF,OAAO;YAC/D,OAAO;QACT,OAAO,IAAIL,gBAAgBO,IAAI,CAACF,OAAO;YACrC,OAAO;QACT,OAAO,IAAIA,KAAKG,UAAU,CAAC,iBAAiB;YAC1C,OAAO;QACT;IACF;IAEA,IAAIF,YAAY;QACd,IAAIH,aAAaI,IAAI,CAACD,aAAa;YACjC,OAAO;QACT;IACF;AACF;AAEA;;;CAGC,GACD,OAAO,SAASG,qBACdC,KAAiB,EACjBC,MAAqB,EACrBC,MAAsC;IAAtCA,IAAAA,mBAAAA,SAAkBC,QAAQC,MAAM,CAACC,KAAK;IAEtC,IAAI,CAACJ,UAAUZ,WAAWW,MAAML,IAAI,GAAG;QACrC,OAAO;IACT;QAOYK,mBAEEA;IAPd,OAAOZ,iBACLa,QACA;QACEK,OAAO;YACL,wDAAwD;YACxDC,MAAMP,CAAAA,oBAAAA,MAAMQ,UAAU,YAAhBR,oBAAoB,CAAC;YAC3B,8DAA8D;YAC9DS,QAAQT,CAAAA,gBAAAA,MAAMS,MAAM,YAAZT,gBAAgB;QAC1B;IACF,GACA;QAAEU,YAAYR;IAAO;AAEzB"}
@@ -1,3 +1,4 @@
1
+ var _process_env___NEXT_DEV_INDICATOR;
1
2
  import { useReducer } from 'react';
2
3
  export const ACTION_STATIC_INDICATOR = 'static-indicator';
3
4
  export const ACTION_BUILD_OK = 'build-ok';
@@ -23,6 +24,7 @@ export const INITIAL_OVERLAY_STATE = {
23
24
  errors: [],
24
25
  notFound: false,
25
26
  staticIndicator: false,
27
+ disableDevIndicator: ((_process_env___NEXT_DEV_INDICATOR = process.env.__NEXT_DEV_INDICATOR) == null ? void 0 : _process_env___NEXT_DEV_INDICATOR.toString()) === 'false',
26
28
  refreshState: {
27
29
  type: 'idle'
28
30
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/client/components/react-dev-overlay/shared.ts"],"sourcesContent":["import { useReducer } from 'react'\n\nimport type { StackFrame } from 'next/dist/compiled/stacktrace-parser'\nimport type { VersionInfo } from '../../../server/dev/parse-version-info'\nimport type { SupportedErrorEvent } from './internal/container/Errors'\nimport type { ComponentStackFrame } from './internal/helpers/parse-component-stack'\nimport type { DebugInfo } from './types'\n\ntype FastRefreshState =\n /** No refresh in progress. */\n | { type: 'idle' }\n /** The refresh process has been triggered, but the new code has not been executed yet. */\n | { type: 'pending'; errors: SupportedErrorEvent[] }\n\nexport interface OverlayState {\n nextId: number\n buildError: string | null\n errors: SupportedErrorEvent[]\n refreshState: FastRefreshState\n rootLayoutMissingTags: typeof window.__next_root_layout_missing_tags\n versionInfo: VersionInfo\n notFound: boolean\n staticIndicator: boolean\n debugInfo: DebugInfo\n}\n\nexport const ACTION_STATIC_INDICATOR = 'static-indicator'\nexport const ACTION_BUILD_OK = 'build-ok'\nexport const ACTION_BUILD_ERROR = 'build-error'\nexport const ACTION_BEFORE_REFRESH = 'before-fast-refresh'\nexport const ACTION_REFRESH = 'fast-refresh'\nexport const ACTION_VERSION_INFO = 'version-info'\nexport const ACTION_UNHANDLED_ERROR = 'unhandled-error'\nexport const ACTION_UNHANDLED_REJECTION = 'unhandled-rejection'\nexport const ACTION_DEBUG_INFO = 'debug-info'\n\ninterface StaticIndicatorAction {\n type: typeof ACTION_STATIC_INDICATOR\n staticIndicator: boolean\n}\n\ninterface BuildOkAction {\n type: typeof ACTION_BUILD_OK\n}\ninterface BuildErrorAction {\n type: typeof ACTION_BUILD_ERROR\n message: string\n}\ninterface BeforeFastRefreshAction {\n type: typeof ACTION_BEFORE_REFRESH\n}\ninterface FastRefreshAction {\n type: typeof ACTION_REFRESH\n}\n\nexport interface UnhandledErrorAction {\n type: typeof ACTION_UNHANDLED_ERROR\n reason: Error\n frames: StackFrame[]\n componentStackFrames?: ComponentStackFrame[]\n warning?: [string, string, string]\n}\nexport interface UnhandledRejectionAction {\n type: typeof ACTION_UNHANDLED_REJECTION\n reason: Error\n frames: StackFrame[]\n}\n\nexport interface DebugInfoAction {\n type: typeof ACTION_DEBUG_INFO\n debugInfo: any\n}\n\ninterface VersionInfoAction {\n type: typeof ACTION_VERSION_INFO\n versionInfo: VersionInfo\n}\n\nexport type BusEvent =\n | BuildOkAction\n | BuildErrorAction\n | BeforeFastRefreshAction\n | FastRefreshAction\n | UnhandledErrorAction\n | UnhandledRejectionAction\n | VersionInfoAction\n | StaticIndicatorAction\n | DebugInfoAction\n\nfunction pushErrorFilterDuplicates(\n errors: SupportedErrorEvent[],\n err: SupportedErrorEvent\n): SupportedErrorEvent[] {\n return [\n ...errors.filter((e) => {\n // Filter out duplicate errors\n return e.event.reason.stack !== err.event.reason.stack\n }),\n err,\n ]\n}\n\nexport const INITIAL_OVERLAY_STATE: OverlayState = {\n nextId: 1,\n buildError: null,\n errors: [],\n notFound: false,\n staticIndicator: false,\n refreshState: { type: 'idle' },\n rootLayoutMissingTags: [],\n versionInfo: { installed: '0.0.0', staleness: 'unknown' },\n debugInfo: { devtoolsFrontendUrl: undefined },\n}\n\nexport function useErrorOverlayReducer() {\n return useReducer((_state: OverlayState, action: BusEvent): OverlayState => {\n switch (action.type) {\n case ACTION_DEBUG_INFO: {\n return { ..._state, debugInfo: action.debugInfo }\n }\n case ACTION_STATIC_INDICATOR: {\n return { ..._state, staticIndicator: action.staticIndicator }\n }\n case ACTION_BUILD_OK: {\n return { ..._state, buildError: null }\n }\n case ACTION_BUILD_ERROR: {\n return { ..._state, buildError: action.message }\n }\n case ACTION_BEFORE_REFRESH: {\n return { ..._state, refreshState: { type: 'pending', errors: [] } }\n }\n case ACTION_REFRESH: {\n return {\n ..._state,\n buildError: null,\n errors:\n // Errors can come in during updates. In this case, UNHANDLED_ERROR\n // and UNHANDLED_REJECTION events might be dispatched between the\n // BEFORE_REFRESH and the REFRESH event. We want to keep those errors\n // around until the next refresh. Otherwise we run into a race\n // condition where those errors would be cleared on refresh completion\n // before they can be displayed.\n _state.refreshState.type === 'pending'\n ? _state.refreshState.errors\n : [],\n refreshState: { type: 'idle' },\n }\n }\n case ACTION_UNHANDLED_ERROR:\n case ACTION_UNHANDLED_REJECTION: {\n switch (_state.refreshState.type) {\n case 'idle': {\n return {\n ..._state,\n nextId: _state.nextId + 1,\n errors: pushErrorFilterDuplicates(_state.errors, {\n id: _state.nextId,\n event: action,\n }),\n }\n }\n case 'pending': {\n return {\n ..._state,\n nextId: _state.nextId + 1,\n refreshState: {\n ..._state.refreshState,\n errors: pushErrorFilterDuplicates(_state.refreshState.errors, {\n id: _state.nextId,\n event: action,\n }),\n },\n }\n }\n default:\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = _state.refreshState\n return _state\n }\n }\n case ACTION_VERSION_INFO: {\n return { ..._state, versionInfo: action.versionInfo }\n }\n default: {\n return _state\n }\n }\n }, INITIAL_OVERLAY_STATE)\n}\n\nexport const REACT_REFRESH_FULL_RELOAD_FROM_ERROR =\n '[Fast Refresh] performing full reload because your application had an unrecoverable error'\n"],"names":["useReducer","ACTION_STATIC_INDICATOR","ACTION_BUILD_OK","ACTION_BUILD_ERROR","ACTION_BEFORE_REFRESH","ACTION_REFRESH","ACTION_VERSION_INFO","ACTION_UNHANDLED_ERROR","ACTION_UNHANDLED_REJECTION","ACTION_DEBUG_INFO","pushErrorFilterDuplicates","errors","err","filter","e","event","reason","stack","INITIAL_OVERLAY_STATE","nextId","buildError","notFound","staticIndicator","refreshState","type","rootLayoutMissingTags","versionInfo","installed","staleness","debugInfo","devtoolsFrontendUrl","undefined","useErrorOverlayReducer","_state","action","message","id","_","REACT_REFRESH_FULL_RELOAD_FROM_ERROR"],"mappings":"AAAA,SAASA,UAAU,QAAQ,QAAO;AA0BlC,OAAO,MAAMC,0BAA0B,mBAAkB;AACzD,OAAO,MAAMC,kBAAkB,WAAU;AACzC,OAAO,MAAMC,qBAAqB,cAAa;AAC/C,OAAO,MAAMC,wBAAwB,sBAAqB;AAC1D,OAAO,MAAMC,iBAAiB,eAAc;AAC5C,OAAO,MAAMC,sBAAsB,eAAc;AACjD,OAAO,MAAMC,yBAAyB,kBAAiB;AACvD,OAAO,MAAMC,6BAA6B,sBAAqB;AAC/D,OAAO,MAAMC,oBAAoB,aAAY;AAuD7C,SAASC,0BACPC,MAA6B,EAC7BC,GAAwB;IAExB,OAAO;WACFD,OAAOE,MAAM,CAAC,CAACC;YAChB,8BAA8B;YAC9B,OAAOA,EAAEC,KAAK,CAACC,MAAM,CAACC,KAAK,KAAKL,IAAIG,KAAK,CAACC,MAAM,CAACC,KAAK;QACxD;QACAL;KACD;AACH;AAEA,OAAO,MAAMM,wBAAsC;IACjDC,QAAQ;IACRC,YAAY;IACZT,QAAQ,EAAE;IACVU,UAAU;IACVC,iBAAiB;IACjBC,cAAc;QAAEC,MAAM;IAAO;IAC7BC,uBAAuB,EAAE;IACzBC,aAAa;QAAEC,WAAW;QAASC,WAAW;IAAU;IACxDC,WAAW;QAAEC,qBAAqBC;IAAU;AAC9C,EAAC;AAED,OAAO,SAASC;IACd,OAAOhC,WAAW,CAACiC,QAAsBC;QACvC,OAAQA,OAAOV,IAAI;YACjB,KAAKf;gBAAmB;oBACtB,OAAO;wBAAE,GAAGwB,MAAM;wBAAEJ,WAAWK,OAAOL,SAAS;oBAAC;gBAClD;YACA,KAAK5B;gBAAyB;oBAC5B,OAAO;wBAAE,GAAGgC,MAAM;wBAAEX,iBAAiBY,OAAOZ,eAAe;oBAAC;gBAC9D;YACA,KAA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;YACA,KAAK3B;gBAAqB;oBACxB,OAAO;wBAAE,GAAG2B,MAAM;wBAAEP,aAAaQ,OAAOR,WAAW;oBAAC;gBACtD;YACA;gBAAS;oBACP,OAAOO;gBACT;QACF;IACF,GAAGf;AACL;AAEA,OAAO,MAAMoB,uCACX,4FAA2F"}
1
+ {"version":3,"sources":["../../../../src/client/components/react-dev-overlay/shared.ts"],"sourcesContent":["import { useReducer } from 'react'\n\nimport type { StackFrame } from 'next/dist/compiled/stacktrace-parser'\nimport type { VersionInfo } from '../../../server/dev/parse-version-info'\nimport type { SupportedErrorEvent } from './internal/container/Errors'\nimport type { ComponentStackFrame } from './internal/helpers/parse-component-stack'\nimport type { DebugInfo } from './types'\n\ntype FastRefreshState =\n /** No refresh in progress. */\n | { type: 'idle' }\n /** The refresh process has been triggered, but the new code has not been executed yet. */\n | { type: 'pending'; errors: SupportedErrorEvent[] }\n\nexport interface OverlayState {\n nextId: number\n buildError: string | null\n errors: SupportedErrorEvent[]\n refreshState: FastRefreshState\n rootLayoutMissingTags: typeof window.__next_root_layout_missing_tags\n versionInfo: VersionInfo\n notFound: boolean\n staticIndicator: boolean\n disableDevIndicator: boolean\n debugInfo: DebugInfo\n}\n\nexport const ACTION_STATIC_INDICATOR = 'static-indicator'\nexport const ACTION_BUILD_OK = 'build-ok'\nexport const ACTION_BUILD_ERROR = 'build-error'\nexport const ACTION_BEFORE_REFRESH = 'before-fast-refresh'\nexport const ACTION_REFRESH = 'fast-refresh'\nexport const ACTION_VERSION_INFO = 'version-info'\nexport const ACTION_UNHANDLED_ERROR = 'unhandled-error'\nexport const ACTION_UNHANDLED_REJECTION = 'unhandled-rejection'\nexport const ACTION_DEBUG_INFO = 'debug-info'\n\ninterface StaticIndicatorAction {\n type: typeof ACTION_STATIC_INDICATOR\n staticIndicator: boolean\n}\n\ninterface BuildOkAction {\n type: typeof ACTION_BUILD_OK\n}\ninterface BuildErrorAction {\n type: typeof ACTION_BUILD_ERROR\n message: string\n}\ninterface BeforeFastRefreshAction {\n type: typeof ACTION_BEFORE_REFRESH\n}\ninterface FastRefreshAction {\n type: typeof ACTION_REFRESH\n}\n\nexport interface UnhandledErrorAction {\n type: typeof ACTION_UNHANDLED_ERROR\n reason: Error\n frames: StackFrame[]\n componentStackFrames?: ComponentStackFrame[]\n warning?: [string, string, string]\n}\nexport interface UnhandledRejectionAction {\n type: typeof ACTION_UNHANDLED_REJECTION\n reason: Error\n frames: StackFrame[]\n}\n\nexport interface DebugInfoAction {\n type: typeof ACTION_DEBUG_INFO\n debugInfo: any\n}\n\ninterface VersionInfoAction {\n type: typeof ACTION_VERSION_INFO\n versionInfo: VersionInfo\n}\n\nexport type BusEvent =\n | BuildOkAction\n | BuildErrorAction\n | BeforeFastRefreshAction\n | FastRefreshAction\n | UnhandledErrorAction\n | UnhandledRejectionAction\n | VersionInfoAction\n | StaticIndicatorAction\n | DebugInfoAction\n\nfunction pushErrorFilterDuplicates(\n errors: SupportedErrorEvent[],\n err: SupportedErrorEvent\n): SupportedErrorEvent[] {\n return [\n ...errors.filter((e) => {\n // Filter out duplicate errors\n return e.event.reason.stack !== err.event.reason.stack\n }),\n err,\n ]\n}\n\nexport const INITIAL_OVERLAY_STATE: OverlayState = {\n nextId: 1,\n buildError: null,\n errors: [],\n notFound: false,\n staticIndicator: false,\n disableDevIndicator: process.env.__NEXT_DEV_INDICATOR?.toString() === 'false',\n refreshState: { type: 'idle' },\n rootLayoutMissingTags: [],\n versionInfo: { installed: '0.0.0', staleness: 'unknown' },\n debugInfo: { devtoolsFrontendUrl: undefined },\n}\n\nexport function useErrorOverlayReducer() {\n return useReducer((_state: OverlayState, action: BusEvent): OverlayState => {\n switch (action.type) {\n case ACTION_DEBUG_INFO: {\n return { ..._state, debugInfo: action.debugInfo }\n }\n case ACTION_STATIC_INDICATOR: {\n return { ..._state, staticIndicator: action.staticIndicator }\n }\n case ACTION_BUILD_OK: {\n return { ..._state, buildError: null }\n }\n case ACTION_BUILD_ERROR: {\n return { ..._state, buildError: action.message }\n }\n case ACTION_BEFORE_REFRESH: {\n return { ..._state, refreshState: { type: 'pending', errors: [] } }\n }\n case ACTION_REFRESH: {\n return {\n ..._state,\n buildError: null,\n errors:\n // Errors can come in during updates. In this case, UNHANDLED_ERROR\n // and UNHANDLED_REJECTION events might be dispatched between the\n // BEFORE_REFRESH and the REFRESH event. We want to keep those errors\n // around until the next refresh. Otherwise we run into a race\n // condition where those errors would be cleared on refresh completion\n // before they can be displayed.\n _state.refreshState.type === 'pending'\n ? _state.refreshState.errors\n : [],\n refreshState: { type: 'idle' },\n }\n }\n case ACTION_UNHANDLED_ERROR:\n case ACTION_UNHANDLED_REJECTION: {\n switch (_state.refreshState.type) {\n case 'idle': {\n return {\n ..._state,\n nextId: _state.nextId + 1,\n errors: pushErrorFilterDuplicates(_state.errors, {\n id: _state.nextId,\n event: action,\n }),\n }\n }\n case 'pending': {\n return {\n ..._state,\n nextId: _state.nextId + 1,\n refreshState: {\n ..._state.refreshState,\n errors: pushErrorFilterDuplicates(_state.refreshState.errors, {\n id: _state.nextId,\n event: action,\n }),\n },\n }\n }\n default:\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = _state.refreshState\n return _state\n }\n }\n case ACTION_VERSION_INFO: {\n return { ..._state, versionInfo: action.versionInfo }\n }\n default: {\n return _state\n }\n }\n }, INITIAL_OVERLAY_STATE)\n}\n\nexport const REACT_REFRESH_FULL_RELOAD_FROM_ERROR =\n '[Fast Refresh] performing full reload because your application had an unrecoverable error'\n"],"names":["process","useReducer","ACTION_STATIC_INDICATOR","ACTION_BUILD_OK","ACTION_BUILD_ERROR","ACTION_BEFORE_REFRESH","ACTION_REFRESH","ACTION_VERSION_INFO","ACTION_UNHANDLED_ERROR","ACTION_UNHANDLED_REJECTION","ACTION_DEBUG_INFO","pushErrorFilterDuplicates","errors","err","filter","e","event","reason","stack","INITIAL_OVERLAY_STATE","nextId","buildError","notFound","staticIndicator","disableDevIndicator","env","__NEXT_DEV_INDICATOR","toString","refreshState","type","rootLayoutMissingTags","versionInfo","installed","staleness","debugInfo","devtoolsFrontendUrl","undefined","useErrorOverlayReducer","_state","action","message","id","_","REACT_REFRESH_FULL_RELOAD_FROM_ERROR"],"mappings":"IA6GuBA;AA7GvB,SAASC,UAAU,QAAQ,QAAO;AA2BlC,OAAO,MAAMC,0BAA0B,mBAAkB;AACzD,OAAO,MAAMC,kBAAkB,WAAU;AACzC,OAAO,MAAMC,qBAAqB,cAAa;AAC/C,OAAO,MAAMC,wBAAwB,sBAAqB;AAC1D,OAAO,MAAMC,iBAAiB,eAAc;AAC5C,OAAO,MAAMC,sBAAsB,eAAc;AACjD,OAAO,MAAMC,yBAAyB,kBAAiB;AACvD,OAAO,MAAMC,6BAA6B,sBAAqB;AAC/D,OAAO,MAAMC,oBAAoB,aAAY;AAuD7C,SAASC,0BACPC,MAA6B,EAC7BC,GAAwB;IAExB,OAAO;WACFD,OAAOE,MAAM,CAAC,CAACC;YAChB,8BAA8B;YAC9B,OAAOA,EAAEC,KAAK,CAACC,MAAM,CAACC,KAAK,KAAKL,IAAIG,KAAK,CAACC,MAAM,CAACC,KAAK;QACxD;QACAL;KACD;AACH;AAEA,OAAO,MAAMM,wBAAsC;IACjDC,QAAQ;IACRC,YAAY;IACZT,QAAQ,EAAE;IACVU,UAAU;IACVC,iBAAiB;IACjBC,qBAAqBxB,EAAAA,oCAAAA,QAAQyB,GAAG,CAACC,oBAAoB,qBAAhC1B,kCAAkC2B,QAAQ,QAAO;IACtEC,cAAc;QAAEC,MAAM;IAAO;IAC7BC,uBAAuB,EAAE;IACzBC,aAAa;QAAEC,WAAW;QAASC,WAAW;IAAU;IACxDC,WAAW;QAAEC,qBAAqBC;IAAU;AAC9C,EAAC;AAED,OAAO,SAASC;IACd,OAAOpC,WAAW,CAACqC,QAAsBC;QACvC,OAAQA,OAAOV,IAAI;YACjB,KAAKnB;gBAAmB;oBACtB,OAAO;wBAAE,GAAG4B,MAAM;wBAAEJ,WAAWK,OAAOL,SAAS;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B,IAAIH,OAAOlB,MAAM;4CACjBJ,OAAOuB;wCACT;oCACF;gCACF;4BACF;wBACA;4BACE,6DAA6D;4BAC7D,MAAMG,IAAWJ,OAAOV,YAAY;4BACpC,OAAOU;oBACX;gBACF;YACA,KAAK/B;gBAAqB;oBACxB,OAAO;wBAAE,GAAG+B,MAAM;wBAAEP,aAAaQ,OAAOR,WAAW;oBAAC;gBACtD;YACA;gBAAS;oBACP,OAAOO;gBACT;QACF;IACF,GAAGnB;AACL;AAEA,OAAO,MAAMwB,uCACX,4FAA2F"}
@@ -25,9 +25,8 @@ import { adaptForAppRouterInstance, adaptForPathParams, adaptForSearchParams, Pa
25
25
  import { SearchParamsContext, PathParamsContext } from '../shared/lib/hooks-client-context.shared-runtime';
26
26
  import { onRecoverableError } from './react-client-callbacks/on-recoverable-error';
27
27
  import tracer from './tracing/tracer';
28
- import reportToSocket from './tracing/report-to-socket';
29
28
  import { isNextRouterError } from './components/is-next-router-error';
30
- export const version = "15.2.0-canary.65";
29
+ export const version = "15.2.0-canary.66";
31
30
  export let router;
32
31
  export const emitter = mitt();
33
32
  const looseToArray = (input)=>[].slice.call(input);
@@ -99,9 +98,9 @@ class Container extends React.Component {
99
98
  }
100
99
  export async function initialize(opts) {
101
100
  if (opts === void 0) opts = {};
102
- tracer.onSpanEnd(reportToSocket);
103
101
  // This makes sure this specific lines are removed in production
104
102
  if (process.env.NODE_ENV === 'development') {
103
+ tracer.onSpanEnd(require('./tracing/report-to-socket').default);
105
104
  devClient = opts.devClient;
106
105
  }
107
106
  initialData = JSON.parse(document.getElementById('__NEXT_DATA__').textContent);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/client/index.tsx"],"sourcesContent":["/* global location */\n// imports polyfill from `@next/polyfill-module` after build.\nimport '../build/polyfills/polyfill-module'\nimport type Router from '../shared/lib/router/router'\nimport type {\n AppComponent,\n AppProps,\n PrivateRouteInfo,\n} from '../shared/lib/router/router'\n\nimport React, { type JSX } from 'react'\nimport ReactDOM from 'react-dom/client'\nimport { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime'\nimport mitt from '../shared/lib/mitt'\nimport type { MittEmitter } from '../shared/lib/mitt'\nimport { RouterContext } from '../shared/lib/router-context.shared-runtime'\nimport { handleSmoothScroll } from '../shared/lib/router/utils/handle-smooth-scroll'\nimport { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic'\nimport {\n urlQueryToSearchParams,\n assign,\n} from '../shared/lib/router/utils/querystring'\nimport { setConfig } from '../shared/lib/runtime-config.external'\nimport { getURL, loadGetInitialProps, ST } from '../shared/lib/utils'\nimport type { NextWebVitalsMetric, NEXT_DATA } from '../shared/lib/utils'\nimport { Portal } from './portal'\nimport initHeadManager from './head-manager'\nimport PageLoader from './page-loader'\nimport type { StyleSheetTuple } from './page-loader'\nimport { RouteAnnouncer } from './route-announcer'\nimport { createRouter, makePublicRouterInstance } from './router'\nimport { getProperError } from '../lib/is-error'\nimport { ImageConfigContext } from '../shared/lib/image-config-context.shared-runtime'\nimport type { ImageConfigComplete } from '../shared/lib/image-config'\nimport { removeBasePath } from './remove-base-path'\nimport { hasBasePath } from './has-base-path'\nimport { AppRouterContext } from '../shared/lib/app-router-context.shared-runtime'\nimport {\n adaptForAppRouterInstance,\n adaptForPathParams,\n adaptForSearchParams,\n PathnameContextProviderAdapter,\n} from '../shared/lib/router/adapters'\nimport {\n SearchParamsContext,\n PathParamsContext,\n} from '../shared/lib/hooks-client-context.shared-runtime'\nimport { onRecoverableError } from './react-client-callbacks/on-recoverable-error'\nimport tracer from './tracing/tracer'\nimport reportToSocket from './tracing/report-to-socket'\nimport { isNextRouterError } from './components/is-next-router-error'\n\n/// <reference types=\"react-dom/experimental\" />\n\ndeclare global {\n interface Window {\n /* test fns */\n __NEXT_HYDRATED?: boolean\n __NEXT_HYDRATED_CB?: () => void\n\n /* prod */\n __NEXT_DATA__: NEXT_DATA\n __NEXT_P: any[]\n }\n}\ntype RenderRouteInfo = PrivateRouteInfo & {\n App: AppComponent\n scroll?: { x: number; y: number } | null\n isHydratePass?: boolean\n}\ntype RenderErrorProps = Omit<RenderRouteInfo, 'Component' | 'styleSheets'>\ntype RegisterFn = (input: [string, () => void]) => void\n\nexport const version = process.env.__NEXT_VERSION\nexport let router: Router\nexport const emitter: MittEmitter<string> = mitt()\n\nconst looseToArray = <T extends {}>(input: any): T[] => [].slice.call(input)\n\nlet initialData: NEXT_DATA\nlet defaultLocale: string | undefined = undefined\nlet asPath: string\nlet pageLoader: PageLoader\nlet appElement: HTMLElement | null\nlet headManager: {\n mountedInstances: Set<unknown>\n updateHead: (head: JSX.Element[]) => void\n getIsSsr?: () => boolean\n}\nlet initialMatchesMiddleware = false\nlet lastAppProps: AppProps\n\nlet lastRenderReject: (() => void) | null\nlet devClient: any\n\nlet CachedApp: AppComponent, onPerfEntry: (metric: any) => void\nlet CachedComponent: React.ComponentType\n\nclass Container extends React.Component<{\n children?: React.ReactNode\n fn: (err: Error, info?: any) => void\n}> {\n componentDidCatch(componentErr: Error, info: any) {\n this.props.fn(componentErr, info)\n }\n\n componentDidMount() {\n this.scrollToHash()\n\n // We need to replace the router state if:\n // - the page was (auto) exported and has a query string or search (hash)\n // - it was auto exported and is a dynamic route (to provide params)\n // - if it is a client-side skeleton (fallback render)\n // - if middleware matches the current page (may have rewrite params)\n // - if rewrites in next.config.js match (may have rewrite params)\n if (\n router.isSsr &&\n (initialData.isFallback ||\n (initialData.nextExport &&\n (isDynamicRoute(router.pathname) ||\n location.search ||\n process.env.__NEXT_HAS_REWRITES ||\n initialMatchesMiddleware)) ||\n (initialData.props &&\n initialData.props.__N_SSG &&\n (location.search ||\n process.env.__NEXT_HAS_REWRITES ||\n initialMatchesMiddleware)))\n ) {\n // update query on mount for exported pages\n router\n .replace(\n router.pathname +\n '?' +\n String(\n assign(\n urlQueryToSearchParams(router.query),\n new URLSearchParams(location.search)\n )\n ),\n asPath,\n {\n // @ts-ignore\n // WARNING: `_h` is an internal option for handing Next.js\n // client-side hydration. Your app should _never_ use this property.\n // It may change at any time without notice.\n _h: 1,\n // Fallback pages must trigger the data fetch, so the transition is\n // not shallow.\n // Other pages (strictly updating query) happens shallowly, as data\n // requirements would already be present.\n shallow: !initialData.isFallback && !initialMatchesMiddleware,\n }\n )\n .catch((err) => {\n if (!err.cancelled) throw err\n })\n }\n }\n\n componentDidUpdate() {\n this.scrollToHash()\n }\n\n scrollToHash() {\n let { hash } = location\n hash = hash && hash.substring(1)\n if (!hash) return\n\n const el: HTMLElement | null = document.getElementById(hash)\n if (!el) return\n\n // If we call scrollIntoView() in here without a setTimeout\n // it won't scroll properly.\n setTimeout(() => el.scrollIntoView(), 0)\n }\n\n render() {\n if (process.env.NODE_ENV === 'production') {\n return this.props.children\n } else {\n const ReactDevOverlay: typeof import('./components/react-dev-overlay/pages/client').ReactDevOverlay =\n require('./components/react-dev-overlay/pages/client').ReactDevOverlay\n return <ReactDevOverlay>{this.props.children}</ReactDevOverlay>\n }\n }\n}\n\nexport async function initialize(opts: { devClient?: any } = {}): Promise<{\n assetPrefix: string\n}> {\n tracer.onSpanEnd(reportToSocket)\n\n // This makes sure this specific lines are removed in production\n if (process.env.NODE_ENV === 'development') {\n devClient = opts.devClient\n }\n\n initialData = JSON.parse(\n document.getElementById('__NEXT_DATA__')!.textContent!\n )\n window.__NEXT_DATA__ = initialData\n\n defaultLocale = initialData.defaultLocale\n const prefix: string = initialData.assetPrefix || ''\n // With dynamic assetPrefix it's no longer possible to set assetPrefix at the build time\n // So, this is how we do it in the client side at runtime\n ;(self as any).__next_set_public_path__(`${prefix}/_next/`) //eslint-disable-line\n\n // Initialize next/config with the environment configuration\n setConfig({\n serverRuntimeConfig: {},\n publicRuntimeConfig: initialData.runtimeConfig || {},\n })\n\n asPath = getURL()\n\n // make sure not to attempt stripping basePath for 404s\n if (hasBasePath(asPath)) {\n asPath = removeBasePath(asPath)\n }\n\n if (process.env.__NEXT_I18N_SUPPORT) {\n const { normalizeLocalePath } =\n require('../shared/lib/i18n/normalize-locale-path') as typeof import('../shared/lib/i18n/normalize-locale-path')\n\n const { detectDomainLocale } =\n require('../shared/lib/i18n/detect-domain-locale') as typeof import('../shared/lib/i18n/detect-domain-locale')\n\n const { parseRelativeUrl } =\n require('../shared/lib/router/utils/parse-relative-url') as typeof import('../shared/lib/router/utils/parse-relative-url')\n\n const { formatUrl } =\n require('../shared/lib/router/utils/format-url') as typeof import('../shared/lib/router/utils/format-url')\n\n if (initialData.locales) {\n const parsedAs = parseRelativeUrl(asPath)\n const localePathResult = normalizeLocalePath(\n parsedAs.pathname,\n initialData.locales\n )\n\n if (localePathResult.detectedLocale) {\n parsedAs.pathname = localePathResult.pathname\n asPath = formatUrl(parsedAs)\n } else {\n // derive the default locale if it wasn't detected in the asPath\n // since we don't prerender static pages with all possible default\n // locales\n defaultLocale = initialData.locale\n }\n\n // attempt detecting default locale based on hostname\n const detectedDomain = detectDomainLocale(\n process.env.__NEXT_I18N_DOMAINS as any,\n window.location.hostname\n )\n\n // TODO: investigate if defaultLocale needs to be populated after\n // hydration to prevent mismatched renders\n if (detectedDomain) {\n defaultLocale = detectedDomain.defaultLocale\n }\n }\n }\n\n if (initialData.scriptLoader) {\n const { initScriptLoader } = require('./script')\n initScriptLoader(initialData.scriptLoader)\n }\n\n pageLoader = new PageLoader(initialData.buildId, prefix)\n\n const register: RegisterFn = ([r, f]) =>\n pageLoader.routeLoader.onEntrypoint(r, f)\n if (window.__NEXT_P) {\n // Defer page registration for another tick. This will increase the overall\n // latency in hydrating the page, but reduce the total blocking time.\n window.__NEXT_P.map((p) => setTimeout(() => register(p), 0))\n }\n window.__NEXT_P = []\n ;(window.__NEXT_P as any).push = register\n\n headManager = initHeadManager()\n headManager.getIsSsr = () => {\n return router.isSsr\n }\n\n appElement = document.getElementById('__next')\n return { assetPrefix: prefix }\n}\n\nfunction renderApp(App: AppComponent, appProps: AppProps) {\n return <App {...appProps} />\n}\n\nfunction AppContainer({\n children,\n}: React.PropsWithChildren<{}>): React.ReactElement {\n // Create a memoized value for next/navigation router context.\n const adaptedForAppRouter = React.useMemo(() => {\n return adaptForAppRouterInstance(router)\n }, [])\n return (\n <Container\n fn={(error) =>\n // TODO: Fix disabled eslint rule\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n renderError({ App: CachedApp, err: error }).catch((err) =>\n console.error('Error rendering page: ', err)\n )\n }\n >\n <AppRouterContext.Provider value={adaptedForAppRouter}>\n <SearchParamsContext.Provider value={adaptForSearchParams(router)}>\n <PathnameContextProviderAdapter\n router={router}\n isAutoExport={self.__NEXT_DATA__.autoExport ?? false}\n >\n <PathParamsContext.Provider value={adaptForPathParams(router)}>\n <RouterContext.Provider value={makePublicRouterInstance(router)}>\n <HeadManagerContext.Provider value={headManager}>\n <ImageConfigContext.Provider\n value={\n process.env\n .__NEXT_IMAGE_OPTS as any as ImageConfigComplete\n }\n >\n {children}\n </ImageConfigContext.Provider>\n </HeadManagerContext.Provider>\n </RouterContext.Provider>\n </PathParamsContext.Provider>\n </PathnameContextProviderAdapter>\n </SearchParamsContext.Provider>\n </AppRouterContext.Provider>\n </Container>\n )\n}\n\nconst wrapApp =\n (App: AppComponent) =>\n (wrappedAppProps: Record<string, any>): JSX.Element => {\n const appProps: AppProps = {\n ...wrappedAppProps,\n Component: CachedComponent,\n err: initialData.err,\n router,\n }\n return <AppContainer>{renderApp(App, appProps)}</AppContainer>\n }\n\n// This method handles all runtime and debug errors.\n// 404 and 500 errors are special kind of errors\n// and they are still handle via the main render method.\nfunction renderError(renderErrorProps: RenderErrorProps): Promise<any> {\n let { App, err } = renderErrorProps\n\n // In development runtime errors are caught by our overlay\n // In production we catch runtime errors using componentDidCatch which will trigger renderError\n if (process.env.NODE_ENV !== 'production') {\n // A Next.js rendering runtime error is always unrecoverable\n // FIXME: let's make this recoverable (error in GIP client-transition)\n devClient.onUnrecoverableError()\n\n // We need to render an empty <App> so that the `<ReactDevOverlay>` can\n // render itself.\n // TODO: Fix disabled eslint rule\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return doRender({\n App: () => null,\n props: {},\n Component: () => null,\n styleSheets: [],\n })\n }\n\n // Make sure we log the error to the console, otherwise users can't track down issues.\n console.error(err)\n console.error(\n `A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred`\n )\n\n return pageLoader\n .loadPage('/_error')\n .then(({ page: ErrorComponent, styleSheets }) => {\n return lastAppProps?.Component === ErrorComponent\n ? import('../pages/_error')\n .then((errorModule) => {\n return import('../pages/_app').then((appModule) => {\n App = appModule.default as any as AppComponent\n renderErrorProps.App = App\n return errorModule\n })\n })\n .then((m) => ({\n ErrorComponent: m.default as React.ComponentType<{}>,\n styleSheets: [],\n }))\n : { ErrorComponent, styleSheets }\n })\n .then(({ ErrorComponent, styleSheets }) => {\n // In production we do a normal render with the `ErrorComponent` as component.\n // If we've gotten here upon initial render, we can use the props from the server.\n // Otherwise, we need to call `getInitialProps` on `App` before mounting.\n const AppTree = wrapApp(App)\n const appCtx = {\n Component: ErrorComponent,\n AppTree,\n router,\n ctx: {\n err,\n pathname: initialData.page,\n query: initialData.query,\n asPath,\n AppTree,\n },\n }\n return Promise.resolve(\n renderErrorProps.props?.err\n ? renderErrorProps.props\n : loadGetInitialProps(App, appCtx)\n ).then((initProps) =>\n // TODO: Fix disabled eslint rule\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n doRender({\n ...renderErrorProps,\n err,\n Component: ErrorComponent,\n styleSheets,\n props: initProps,\n })\n )\n })\n}\n\n// Dummy component that we render as a child of Root so that we can\n// toggle the correct styles before the page is rendered.\nfunction Head({ callback }: { callback: () => void }): null {\n // We use `useLayoutEffect` to guarantee the callback is executed\n // as soon as React flushes the update.\n React.useLayoutEffect(() => callback(), [callback])\n return null\n}\n\nconst performanceMarks = {\n navigationStart: 'navigationStart',\n beforeRender: 'beforeRender',\n afterRender: 'afterRender',\n afterHydrate: 'afterHydrate',\n routeChange: 'routeChange',\n} as const\n\nconst performanceMeasures = {\n hydration: 'Next.js-hydration',\n beforeHydration: 'Next.js-before-hydration',\n routeChangeToRender: 'Next.js-route-change-to-render',\n render: 'Next.js-render',\n} as const\n\nlet reactRoot: any = null\n// On initial render a hydrate should always happen\nlet shouldHydrate: boolean = true\n\nfunction clearMarks(): void {\n ;[\n performanceMarks.beforeRender,\n performanceMarks.afterHydrate,\n performanceMarks.afterRender,\n performanceMarks.routeChange,\n ].forEach((mark) => performance.clearMarks(mark))\n}\n\nfunction markHydrateComplete(): void {\n if (!ST) return\n\n performance.mark(performanceMarks.afterHydrate) // mark end of hydration\n\n const hasBeforeRenderMark = performance.getEntriesByName(\n performanceMarks.beforeRender,\n 'mark'\n ).length\n if (hasBeforeRenderMark) {\n const beforeHydrationMeasure = performance.measure(\n performanceMeasures.beforeHydration,\n performanceMarks.navigationStart,\n performanceMarks.beforeRender\n )\n\n const hydrationMeasure = performance.measure(\n performanceMeasures.hydration,\n performanceMarks.beforeRender,\n performanceMarks.afterHydrate\n )\n\n if (\n process.env.NODE_ENV === 'development' &&\n // Old versions of Safari don't return `PerformanceMeasure`s from `performance.measure()`\n beforeHydrationMeasure &&\n hydrationMeasure\n ) {\n tracer\n .startSpan('navigation-to-hydration', {\n startTime: performance.timeOrigin + beforeHydrationMeasure.startTime,\n attributes: {\n pathname: location.pathname,\n query: location.search,\n },\n })\n .end(\n performance.timeOrigin +\n hydrationMeasure.startTime +\n hydrationMeasure.duration\n )\n }\n }\n\n if (onPerfEntry) {\n performance\n .getEntriesByName(performanceMeasures.hydration)\n .forEach(onPerfEntry)\n }\n clearMarks()\n}\n\nfunction markRenderComplete(): void {\n if (!ST) return\n\n performance.mark(performanceMarks.afterRender) // mark end of render\n const navStartEntries: PerformanceEntryList = performance.getEntriesByName(\n performanceMarks.routeChange,\n 'mark'\n )\n\n if (!navStartEntries.length) return\n\n const hasBeforeRenderMark = performance.getEntriesByName(\n performanceMarks.beforeRender,\n 'mark'\n ).length\n\n if (hasBeforeRenderMark) {\n performance.measure(\n performanceMeasures.routeChangeToRender,\n navStartEntries[0].name,\n performanceMarks.beforeRender\n )\n performance.measure(\n performanceMeasures.render,\n performanceMarks.beforeRender,\n performanceMarks.afterRender\n )\n if (onPerfEntry) {\n performance\n .getEntriesByName(performanceMeasures.render)\n .forEach(onPerfEntry)\n performance\n .getEntriesByName(performanceMeasures.routeChangeToRender)\n .forEach(onPerfEntry)\n }\n }\n\n clearMarks()\n ;[\n performanceMeasures.routeChangeToRender,\n performanceMeasures.render,\n ].forEach((measure) => performance.clearMeasures(measure))\n}\n\nfunction renderReactElement(\n domEl: HTMLElement,\n fn: (cb: () => void) => JSX.Element\n): void {\n // mark start of hydrate/render\n if (ST) {\n performance.mark(performanceMarks.beforeRender)\n }\n\n const reactEl = fn(shouldHydrate ? markHydrateComplete : markRenderComplete)\n if (!reactRoot) {\n // Unlike with createRoot, you don't need a separate root.render() call here\n reactRoot = ReactDOM.hydrateRoot(domEl, reactEl, {\n onRecoverableError,\n })\n // TODO: Remove shouldHydrate variable when React 18 is stable as it can depend on `reactRoot` existing\n shouldHydrate = false\n } else {\n const startTransition = (React as any).startTransition\n startTransition(() => {\n reactRoot.render(reactEl)\n })\n }\n}\n\nfunction Root({\n callbacks,\n children,\n}: React.PropsWithChildren<{\n callbacks: Array<() => void>\n}>): React.ReactElement {\n // We use `useLayoutEffect` to guarantee the callbacks are executed\n // as soon as React flushes the update\n React.useLayoutEffect(\n () => callbacks.forEach((callback) => callback()),\n [callbacks]\n )\n\n if (process.env.__NEXT_TEST_MODE) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n window.__NEXT_HYDRATED = true\n\n if (window.__NEXT_HYDRATED_CB) {\n window.__NEXT_HYDRATED_CB()\n }\n }, [])\n }\n\n return children as React.ReactElement\n}\n\nfunction doRender(input: RenderRouteInfo): Promise<any> {\n let { App, Component, props, err }: RenderRouteInfo = input\n let styleSheets: StyleSheetTuple[] | undefined =\n 'initial' in input ? undefined : input.styleSheets\n Component = Component || lastAppProps.Component\n props = props || lastAppProps.props\n\n const appProps: AppProps = {\n ...props,\n Component,\n err,\n router,\n }\n // lastAppProps has to be set before ReactDom.render to account for ReactDom throwing an error.\n lastAppProps = appProps\n\n let canceled: boolean = false\n let resolvePromise: () => void\n const renderPromise = new Promise<void>((resolve, reject) => {\n if (lastRenderReject) {\n lastRenderReject()\n }\n resolvePromise = () => {\n lastRenderReject = null\n resolve()\n }\n lastRenderReject = () => {\n canceled = true\n lastRenderReject = null\n\n const error: any = new Error('Cancel rendering route')\n error.cancelled = true\n reject(error)\n }\n })\n\n // This function has a return type to ensure it doesn't start returning a\n // Promise. It should remain synchronous.\n function onStart(): boolean {\n if (\n !styleSheets ||\n // We use `style-loader` in development, so we don't need to do anything\n // unless we're in production:\n process.env.NODE_ENV !== 'production'\n ) {\n return false\n }\n\n const currentStyleTags: HTMLStyleElement[] = looseToArray<HTMLStyleElement>(\n document.querySelectorAll('style[data-n-href]')\n )\n const currentHrefs: Set<string | null> = new Set(\n currentStyleTags.map((tag) => tag.getAttribute('data-n-href'))\n )\n\n const noscript: Element | null = document.querySelector(\n 'noscript[data-n-css]'\n )\n const nonce: string | null | undefined =\n noscript?.getAttribute('data-n-css')\n\n styleSheets.forEach(({ href, text }: { href: string; text: any }) => {\n if (!currentHrefs.has(href)) {\n const styleTag = document.createElement('style')\n styleTag.setAttribute('data-n-href', href)\n styleTag.setAttribute('media', 'x')\n\n if (nonce) {\n styleTag.setAttribute('nonce', nonce)\n }\n\n document.head.appendChild(styleTag)\n styleTag.appendChild(document.createTextNode(text))\n }\n })\n return true\n }\n\n function onHeadCommit(): void {\n if (\n // Turbopack has it's own css injection handling, this code ends up removing the CSS.\n !process.env.TURBOPACK &&\n // We use `style-loader` in development, so we don't need to do anything\n // unless we're in production:\n process.env.NODE_ENV === 'production' &&\n // We can skip this during hydration. Running it wont cause any harm, but\n // we may as well save the CPU cycles:\n styleSheets &&\n // Ensure this render was not canceled\n !canceled\n ) {\n const desiredHrefs: Set<string> = new Set(styleSheets.map((s) => s.href))\n const currentStyleTags: HTMLStyleElement[] =\n looseToArray<HTMLStyleElement>(\n document.querySelectorAll('style[data-n-href]')\n )\n const currentHrefs: string[] = currentStyleTags.map(\n (tag) => tag.getAttribute('data-n-href')!\n )\n\n // Toggle `<style>` tags on or off depending on if they're needed:\n for (let idx = 0; idx < currentHrefs.length; ++idx) {\n if (desiredHrefs.has(currentHrefs[idx])) {\n currentStyleTags[idx].removeAttribute('media')\n } else {\n currentStyleTags[idx].setAttribute('media', 'x')\n }\n }\n\n // Reorder styles into intended order:\n let referenceNode: Element | null = document.querySelector(\n 'noscript[data-n-css]'\n )\n if (\n // This should be an invariant:\n referenceNode\n ) {\n styleSheets.forEach(({ href }: { href: string }) => {\n const targetTag: Element | null = document.querySelector(\n `style[data-n-href=\"${href}\"]`\n )\n if (\n // This should be an invariant:\n targetTag\n ) {\n referenceNode!.parentNode!.insertBefore(\n targetTag,\n referenceNode!.nextSibling\n )\n referenceNode = targetTag\n }\n })\n }\n\n // Finally, clean up server rendered stylesheets:\n looseToArray<HTMLLinkElement>(\n document.querySelectorAll('link[data-n-p]')\n ).forEach((el) => {\n el.parentNode!.removeChild(el)\n })\n }\n\n if (input.scroll) {\n const { x, y } = input.scroll\n handleSmoothScroll(() => {\n window.scrollTo(x, y)\n })\n }\n }\n\n function onRootCommit(): void {\n resolvePromise()\n }\n\n onStart()\n\n const elem: JSX.Element = (\n <>\n <Head callback={onHeadCommit} />\n <AppContainer>\n {renderApp(App, appProps)}\n <Portal type=\"next-route-announcer\">\n <RouteAnnouncer />\n </Portal>\n </AppContainer>\n </>\n )\n\n // We catch runtime errors using componentDidCatch which will trigger renderError\n renderReactElement(appElement!, (callback) => (\n <Root callbacks={[callback, onRootCommit]}>\n {process.env.__NEXT_STRICT_MODE ? (\n <React.StrictMode>{elem}</React.StrictMode>\n ) : (\n elem\n )}\n </Root>\n ))\n\n return renderPromise\n}\n\nasync function render(renderingProps: RenderRouteInfo): Promise<void> {\n // if an error occurs in a server-side page (e.g. in getInitialProps),\n // skip re-rendering the error page client-side as data-fetching operations\n // will already have been done on the server and NEXT_DATA contains the correct\n // data for straight-forward hydration of the error page\n if (\n renderingProps.err &&\n // renderingProps.Component might be undefined if there is a top/module-level error\n (typeof renderingProps.Component === 'undefined' ||\n !renderingProps.isHydratePass)\n ) {\n await renderError(renderingProps)\n return\n }\n\n try {\n await doRender(renderingProps)\n } catch (err) {\n const renderErr = getProperError(err)\n // bubble up cancelation errors\n if ((renderErr as Error & { cancelled?: boolean }).cancelled) {\n throw renderErr\n }\n\n if (process.env.NODE_ENV === 'development') {\n // Ensure this error is displayed in the overlay in development\n setTimeout(() => {\n throw renderErr\n })\n }\n await renderError({ ...renderingProps, err: renderErr })\n }\n}\n\nexport async function hydrate(opts?: { beforeRender?: () => Promise<void> }) {\n let initialErr = initialData.err\n\n try {\n const appEntrypoint = await pageLoader.routeLoader.whenEntrypoint('/_app')\n if ('error' in appEntrypoint) {\n throw appEntrypoint.error\n }\n\n const { component: app, exports: mod } = appEntrypoint\n CachedApp = app as AppComponent\n if (mod && mod.reportWebVitals) {\n onPerfEntry = ({\n id,\n name,\n startTime,\n value,\n duration,\n entryType,\n entries,\n attribution,\n }: any): void => {\n // Combines timestamp with random number for unique ID\n const uniqueID: string = `${Date.now()}-${\n Math.floor(Math.random() * (9e12 - 1)) + 1e12\n }`\n let perfStartEntry: string | undefined\n\n if (entries && entries.length) {\n perfStartEntry = entries[0].startTime\n }\n\n const webVitals: NextWebVitalsMetric = {\n id: id || uniqueID,\n name,\n startTime: startTime || perfStartEntry,\n value: value == null ? duration : value,\n label:\n entryType === 'mark' || entryType === 'measure'\n ? 'custom'\n : 'web-vital',\n }\n if (attribution) {\n webVitals.attribution = attribution\n }\n mod.reportWebVitals(webVitals)\n }\n }\n\n const pageEntrypoint =\n // The dev server fails to serve script assets when there's a hydration\n // error, so we need to skip waiting for the entrypoint.\n process.env.NODE_ENV === 'development' && initialData.err\n ? { error: initialData.err }\n : await pageLoader.routeLoader.whenEntrypoint(initialData.page)\n if ('error' in pageEntrypoint) {\n throw pageEntrypoint.error\n }\n CachedComponent = pageEntrypoint.component\n\n if (process.env.NODE_ENV !== 'production') {\n const { isValidElementType } = require('next/dist/compiled/react-is')\n if (!isValidElementType(CachedComponent)) {\n throw new Error(\n `The default export is not a React Component in page: \"${initialData.page}\"`\n )\n }\n }\n } catch (error) {\n // This catches errors like throwing in the top level of a module\n initialErr = getProperError(error)\n }\n\n if (process.env.NODE_ENV === 'development') {\n const getServerError: typeof import('./components/react-dev-overlay/pages/client').getServerError =\n require('./components/react-dev-overlay/pages/client').getServerError\n // Server-side runtime errors need to be re-thrown on the client-side so\n // that the overlay is rendered.\n if (initialErr) {\n if (initialErr === initialData.err) {\n setTimeout(() => {\n let error\n try {\n // Generate a new error object. We `throw` it because some browsers\n // will set the `stack` when thrown, and we want to ensure ours is\n // not overridden when we re-throw it below.\n throw new Error(initialErr!.message)\n } catch (e) {\n error = e as Error\n }\n\n error.name = initialErr!.name\n error.stack = initialErr!.stack\n const errSource = initialErr.source!\n\n // In development, error the navigation API usage in runtime,\n // since it's not allowed to be used in pages router as it doesn't contain error boundary like app router.\n if (isNextRouterError(initialErr)) {\n error.message =\n 'Next.js navigation API is not allowed to be used in Pages Router.'\n }\n\n throw getServerError(error, errSource)\n })\n }\n // We replaced the server-side error with a client-side error, and should\n // no longer rewrite the stack trace to a Node error.\n else {\n setTimeout(() => {\n throw initialErr\n })\n }\n }\n }\n\n if (window.__NEXT_PRELOADREADY) {\n await window.__NEXT_PRELOADREADY(initialData.dynamicIds)\n }\n\n router = createRouter(initialData.page, initialData.query, asPath, {\n initialProps: initialData.props,\n pageLoader,\n App: CachedApp,\n Component: CachedComponent,\n wrapApp,\n err: initialErr,\n isFallback: Boolean(initialData.isFallback),\n subscription: (info, App, scroll) =>\n render(\n Object.assign<\n {},\n Omit<RenderRouteInfo, 'App' | 'scroll'>,\n Pick<RenderRouteInfo, 'App' | 'scroll'>\n >({}, info, {\n App,\n scroll,\n }) as RenderRouteInfo\n ),\n locale: initialData.locale,\n locales: initialData.locales,\n defaultLocale,\n domainLocales: initialData.domainLocales,\n isPreview: initialData.isPreview,\n })\n\n initialMatchesMiddleware = await router._initialMatchesMiddlewarePromise\n\n const renderCtx: RenderRouteInfo = {\n App: CachedApp,\n initial: true,\n Component: CachedComponent,\n props: initialData.props,\n err: initialErr,\n isHydratePass: true,\n }\n\n if (opts?.beforeRender) {\n await opts.beforeRender()\n }\n\n render(renderCtx)\n}\n"],"names":["React","ReactDOM","HeadManagerContext","mitt","RouterContext","handleSmoothScroll","isDynamicRoute","urlQueryToSearchParams","assign","setConfig","getURL","loadGetInitialProps","ST","Portal","initHeadManager","PageLoader","RouteAnnouncer","createRouter","makePublicRouterInstance","getProperError","ImageConfigContext","removeBasePath","hasBasePath","AppRouterContext","adaptForAppRouterInstance","adaptForPathParams","adaptForSearchParams","PathnameContextProviderAdapter","SearchParamsContext","PathParamsContext","onRecoverableError","tracer","reportToSocket","isNextRouterError","version","process","env","__NEXT_VERSION","router","emitter","looseToArray","input","slice","call","initialData","defaultLocale","undefined","asPath","pageLoader","appElement","headManager","initialMatchesMiddleware","lastAppProps","lastRenderReject","devClient","CachedApp","onPerfEntry","CachedComponent","Container","Component","componentDidCatch","componentErr","info","props","fn","componentDidMount","scrollToHash","isSsr","isFallback","nextExport","pathname","location","search","__NEXT_HAS_REWRITES","__N_SSG","replace","String","query","URLSearchParams","_h","shallow","catch","err","cancelled","componentDidUpdate","hash","substring","el","document","getElementById","setTimeout","scrollIntoView","render","NODE_ENV","children","ReactDevOverlay","require","initialize","opts","onSpanEnd","JSON","parse","textContent","window","__NEXT_DATA__","prefix","assetPrefix","self","__next_set_public_path__","serverRuntimeConfig","publicRuntimeConfig","runtimeConfig","__NEXT_I18N_SUPPORT","normalizeLocalePath","detectDomainLocale","parseRelativeUrl","formatUrl","locales","parsedAs","localePathResult","detectedLocale","locale","detectedDomain","__NEXT_I18N_DOMAINS","hostname","scriptLoader","initScriptLoader","buildId","register","r","f","routeLoader","onEntrypoint","__NEXT_P","map","p","push","getIsSsr","renderApp","App","appProps","AppContainer","adaptedForAppRouter","useMemo","error","renderError","console","Provider","value","isAutoExport","autoExport","__NEXT_IMAGE_OPTS","wrapApp","wrappedAppProps","renderErrorProps","onUnrecoverableError","doRender","styleSheets","loadPage","then","page","ErrorComponent","errorModule","appModule","default","m","AppTree","appCtx","ctx","Promise","resolve","initProps","Head","callback","useLayoutEffect","performanceMarks","navigationStart","beforeRender","afterRender","afterHydrate","routeChange","performanceMeasures","hydration","beforeHydration","routeChangeToRender","reactRoot","shouldHydrate","clearMarks","forEach","mark","performance","markHydrateComplete","hasBeforeRenderMark","getEntriesByName","length","beforeHydrationMeasure","measure","hydrationMeasure","startSpan","startTime","timeOrigin","attributes","end","duration","markRenderComplete","navStartEntries","name","clearMeasures","renderReactElement","domEl","reactEl","hydrateRoot","startTransition","Root","callbacks","__NEXT_TEST_MODE","useEffect","__NEXT_HYDRATED","__NEXT_HYDRATED_CB","canceled","resolvePromise","renderPromise","reject","Error","onStart","currentStyleTags","querySelectorAll","currentHrefs","Set","tag","getAttribute","noscript","querySelector","nonce","href","text","has","styleTag","createElement","setAttribute","head","appendChild","createTextNode","onHeadCommit","TURBOPACK","desiredHrefs","s","idx","removeAttribute","referenceNode","targetTag","parentNode","insertBefore","nextSibling","removeChild","scroll","x","y","scrollTo","onRootCommit","elem","type","__NEXT_STRICT_MODE","StrictMode","renderingProps","isHydratePass","renderErr","hydrate","initialErr","appEntrypoint","whenEntrypoint","component","app","exports","mod","reportWebVitals","id","entryType","entries","attribution","uniqueID","Date","now","Math","floor","random","perfStartEntry","webVitals","label","pageEntrypoint","isValidElementType","getServerError","message","e","stack","errSource","source","__NEXT_PRELOADREADY","dynamicIds","initialProps","Boolean","subscription","Object","domainLocales","isPreview","_initialMatchesMiddlewarePromise","renderCtx","initial"],"mappings":"AAAA,mBAAmB,GACnB,6DAA6D;;AAC7D,OAAO,qCAAoC;AAQ3C,OAAOA,WAAyB,QA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F;IAEA,IAAIrK,OAAOkM,mBAAmB,EAAE;QAC9B,MAAMlM,OAAOkM,mBAAmB,CAAC7P,YAAY8P,UAAU;IACzD;IAEApQ,SAASrB,aAAa2B,YAAYoH,IAAI,EAAEpH,YAAYiC,KAAK,EAAE9B,QAAQ;QACjE4P,cAAc/P,YAAYmB,KAAK;QAC/Bf;QACA2F,KAAKpF;QACLI,WAAWF;QACX+F;QACAtE,KAAK0L;QACLxM,YAAYwO,QAAQhQ,YAAYwB,UAAU;QAC1CyO,cAAc,CAAC/O,MAAM6E,KAAKoH,SACxBnK,OACEkN,OAAOtS,MAAM,CAIX,CAAC,GAAGsD,MAAM;gBACV6E;gBACAoH;YACF;QAEJtI,QAAQ7E,YAAY6E,MAAM;QAC1BJ,SAASzE,YAAYyE,OAAO;QAC5BxE;QACAkQ,eAAenQ,YAAYmQ,aAAa;QACxCC,WAAWpQ,YAAYoQ,SAAS;IAClC;IAEA7P,2BAA2B,MAAMb,OAAO2Q,gCAAgC;IAExE,MAAMC,YAA6B;QACjCvK,KAAKpF;QACL4P,SAAS;QACTxP,WAAWF;QACXM,OAAOnB,YAAYmB,KAAK;QACxBmB,KAAK0L;QACLH,eAAe;IACjB;IAEA,IAAIvK,wBAAAA,KAAM+E,YAAY,EAAE;QACtB,MAAM/E,KAAK+E,YAAY;IACzB;IAEArF,OAAOsN;AACT"}
1
+ {"version":3,"sources":["../../src/client/index.tsx"],"sourcesContent":["/* global location */\n// imports polyfill from `@next/polyfill-module` after build.\nimport '../build/polyfills/polyfill-module'\nimport type Router from '../shared/lib/router/router'\nimport type {\n AppComponent,\n AppProps,\n PrivateRouteInfo,\n} from '../shared/lib/router/router'\n\nimport React, { type JSX } from 'react'\nimport ReactDOM from 'react-dom/client'\nimport { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime'\nimport mitt from '../shared/lib/mitt'\nimport type { MittEmitter } from '../shared/lib/mitt'\nimport { RouterContext } from '../shared/lib/router-context.shared-runtime'\nimport { handleSmoothScroll } from '../shared/lib/router/utils/handle-smooth-scroll'\nimport { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic'\nimport {\n urlQueryToSearchParams,\n assign,\n} from '../shared/lib/router/utils/querystring'\nimport { setConfig } from '../shared/lib/runtime-config.external'\nimport { getURL, loadGetInitialProps, ST } from '../shared/lib/utils'\nimport type { NextWebVitalsMetric, NEXT_DATA } from '../shared/lib/utils'\nimport { Portal } from './portal'\nimport initHeadManager from './head-manager'\nimport PageLoader from './page-loader'\nimport type { StyleSheetTuple } from './page-loader'\nimport { RouteAnnouncer } from './route-announcer'\nimport { createRouter, makePublicRouterInstance } from './router'\nimport { getProperError } from '../lib/is-error'\nimport { ImageConfigContext } from '../shared/lib/image-config-context.shared-runtime'\nimport type { ImageConfigComplete } from '../shared/lib/image-config'\nimport { removeBasePath } from './remove-base-path'\nimport { hasBasePath } from './has-base-path'\nimport { AppRouterContext } from '../shared/lib/app-router-context.shared-runtime'\nimport {\n adaptForAppRouterInstance,\n adaptForPathParams,\n adaptForSearchParams,\n PathnameContextProviderAdapter,\n} from '../shared/lib/router/adapters'\nimport {\n SearchParamsContext,\n PathParamsContext,\n} from '../shared/lib/hooks-client-context.shared-runtime'\nimport { onRecoverableError } from './react-client-callbacks/on-recoverable-error'\nimport tracer from './tracing/tracer'\nimport { isNextRouterError } from './components/is-next-router-error'\n\n/// <reference types=\"react-dom/experimental\" />\n\ndeclare global {\n interface Window {\n /* test fns */\n __NEXT_HYDRATED?: boolean\n __NEXT_HYDRATED_CB?: () => void\n\n /* prod */\n __NEXT_DATA__: NEXT_DATA\n __NEXT_P: any[]\n }\n}\ntype RenderRouteInfo = PrivateRouteInfo & {\n App: AppComponent\n scroll?: { x: number; y: number } | null\n isHydratePass?: boolean\n}\ntype RenderErrorProps = Omit<RenderRouteInfo, 'Component' | 'styleSheets'>\ntype RegisterFn = (input: [string, () => void]) => void\n\nexport const version = process.env.__NEXT_VERSION\nexport let router: Router\nexport const emitter: MittEmitter<string> = mitt()\n\nconst looseToArray = <T extends {}>(input: any): T[] => [].slice.call(input)\n\nlet initialData: NEXT_DATA\nlet defaultLocale: string | undefined = undefined\nlet asPath: string\nlet pageLoader: PageLoader\nlet appElement: HTMLElement | null\nlet headManager: {\n mountedInstances: Set<unknown>\n updateHead: (head: JSX.Element[]) => void\n getIsSsr?: () => boolean\n}\nlet initialMatchesMiddleware = false\nlet lastAppProps: AppProps\n\nlet lastRenderReject: (() => void) | null\nlet devClient: any\n\nlet CachedApp: AppComponent, onPerfEntry: (metric: any) => void\nlet CachedComponent: React.ComponentType\n\nclass Container extends React.Component<{\n children?: React.ReactNode\n fn: (err: Error, info?: any) => void\n}> {\n componentDidCatch(componentErr: Error, info: any) {\n this.props.fn(componentErr, info)\n }\n\n componentDidMount() {\n this.scrollToHash()\n\n // We need to replace the router state if:\n // - the page was (auto) exported and has a query string or search (hash)\n // - it was auto exported and is a dynamic route (to provide params)\n // - if it is a client-side skeleton (fallback render)\n // - if middleware matches the current page (may have rewrite params)\n // - if rewrites in next.config.js match (may have rewrite params)\n if (\n router.isSsr &&\n (initialData.isFallback ||\n (initialData.nextExport &&\n (isDynamicRoute(router.pathname) ||\n location.search ||\n process.env.__NEXT_HAS_REWRITES ||\n initialMatchesMiddleware)) ||\n (initialData.props &&\n initialData.props.__N_SSG &&\n (location.search ||\n process.env.__NEXT_HAS_REWRITES ||\n initialMatchesMiddleware)))\n ) {\n // update query on mount for exported pages\n router\n .replace(\n router.pathname +\n '?' +\n String(\n assign(\n urlQueryToSearchParams(router.query),\n new URLSearchParams(location.search)\n )\n ),\n asPath,\n {\n // @ts-ignore\n // WARNING: `_h` is an internal option for handing Next.js\n // client-side hydration. Your app should _never_ use this property.\n // It may change at any time without notice.\n _h: 1,\n // Fallback pages must trigger the data fetch, so the transition is\n // not shallow.\n // Other pages (strictly updating query) happens shallowly, as data\n // requirements would already be present.\n shallow: !initialData.isFallback && !initialMatchesMiddleware,\n }\n )\n .catch((err) => {\n if (!err.cancelled) throw err\n })\n }\n }\n\n componentDidUpdate() {\n this.scrollToHash()\n }\n\n scrollToHash() {\n let { hash } = location\n hash = hash && hash.substring(1)\n if (!hash) return\n\n const el: HTMLElement | null = document.getElementById(hash)\n if (!el) return\n\n // If we call scrollIntoView() in here without a setTimeout\n // it won't scroll properly.\n setTimeout(() => el.scrollIntoView(), 0)\n }\n\n render() {\n if (process.env.NODE_ENV === 'production') {\n return this.props.children\n } else {\n const ReactDevOverlay: typeof import('./components/react-dev-overlay/pages/client').ReactDevOverlay =\n require('./components/react-dev-overlay/pages/client').ReactDevOverlay\n return <ReactDevOverlay>{this.props.children}</ReactDevOverlay>\n }\n }\n}\n\nexport async function initialize(opts: { devClient?: any } = {}): Promise<{\n assetPrefix: string\n}> {\n // This makes sure this specific lines are removed in production\n if (process.env.NODE_ENV === 'development') {\n tracer.onSpanEnd(\n (\n require('./tracing/report-to-socket') as typeof import('./tracing/report-to-socket')\n ).default\n )\n devClient = opts.devClient\n }\n\n initialData = JSON.parse(\n document.getElementById('__NEXT_DATA__')!.textContent!\n )\n window.__NEXT_DATA__ = initialData\n\n defaultLocale = initialData.defaultLocale\n const prefix: string = initialData.assetPrefix || ''\n // With dynamic assetPrefix it's no longer possible to set assetPrefix at the build time\n // So, this is how we do it in the client side at runtime\n ;(self as any).__next_set_public_path__(`${prefix}/_next/`) //eslint-disable-line\n\n // Initialize next/config with the environment configuration\n setConfig({\n serverRuntimeConfig: {},\n publicRuntimeConfig: initialData.runtimeConfig || {},\n })\n\n asPath = getURL()\n\n // make sure not to attempt stripping basePath for 404s\n if (hasBasePath(asPath)) {\n asPath = removeBasePath(asPath)\n }\n\n if (process.env.__NEXT_I18N_SUPPORT) {\n const { normalizeLocalePath } =\n require('../shared/lib/i18n/normalize-locale-path') as typeof import('../shared/lib/i18n/normalize-locale-path')\n\n const { detectDomainLocale } =\n require('../shared/lib/i18n/detect-domain-locale') as typeof import('../shared/lib/i18n/detect-domain-locale')\n\n const { parseRelativeUrl } =\n require('../shared/lib/router/utils/parse-relative-url') as typeof import('../shared/lib/router/utils/parse-relative-url')\n\n const { formatUrl } =\n require('../shared/lib/router/utils/format-url') as typeof import('../shared/lib/router/utils/format-url')\n\n if (initialData.locales) {\n const parsedAs = parseRelativeUrl(asPath)\n const localePathResult = normalizeLocalePath(\n parsedAs.pathname,\n initialData.locales\n )\n\n if (localePathResult.detectedLocale) {\n parsedAs.pathname = localePathResult.pathname\n asPath = formatUrl(parsedAs)\n } else {\n // derive the default locale if it wasn't detected in the asPath\n // since we don't prerender static pages with all possible default\n // locales\n defaultLocale = initialData.locale\n }\n\n // attempt detecting default locale based on hostname\n const detectedDomain = detectDomainLocale(\n process.env.__NEXT_I18N_DOMAINS as any,\n window.location.hostname\n )\n\n // TODO: investigate if defaultLocale needs to be populated after\n // hydration to prevent mismatched renders\n if (detectedDomain) {\n defaultLocale = detectedDomain.defaultLocale\n }\n }\n }\n\n if (initialData.scriptLoader) {\n const { initScriptLoader } = require('./script')\n initScriptLoader(initialData.scriptLoader)\n }\n\n pageLoader = new PageLoader(initialData.buildId, prefix)\n\n const register: RegisterFn = ([r, f]) =>\n pageLoader.routeLoader.onEntrypoint(r, f)\n if (window.__NEXT_P) {\n // Defer page registration for another tick. This will increase the overall\n // latency in hydrating the page, but reduce the total blocking time.\n window.__NEXT_P.map((p) => setTimeout(() => register(p), 0))\n }\n window.__NEXT_P = []\n ;(window.__NEXT_P as any).push = register\n\n headManager = initHeadManager()\n headManager.getIsSsr = () => {\n return router.isSsr\n }\n\n appElement = document.getElementById('__next')\n return { assetPrefix: prefix }\n}\n\nfunction renderApp(App: AppComponent, appProps: AppProps) {\n return <App {...appProps} />\n}\n\nfunction AppContainer({\n children,\n}: React.PropsWithChildren<{}>): React.ReactElement {\n // Create a memoized value for next/navigation router context.\n const adaptedForAppRouter = React.useMemo(() => {\n return adaptForAppRouterInstance(router)\n }, [])\n return (\n <Container\n fn={(error) =>\n // TODO: Fix disabled eslint rule\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n renderError({ App: CachedApp, err: error }).catch((err) =>\n console.error('Error rendering page: ', err)\n )\n }\n >\n <AppRouterContext.Provider value={adaptedForAppRouter}>\n <SearchParamsContext.Provider value={adaptForSearchParams(router)}>\n <PathnameContextProviderAdapter\n router={router}\n isAutoExport={self.__NEXT_DATA__.autoExport ?? false}\n >\n <PathParamsContext.Provider value={adaptForPathParams(router)}>\n <RouterContext.Provider value={makePublicRouterInstance(router)}>\n <HeadManagerContext.Provider value={headManager}>\n <ImageConfigContext.Provider\n value={\n process.env\n .__NEXT_IMAGE_OPTS as any as ImageConfigComplete\n }\n >\n {children}\n </ImageConfigContext.Provider>\n </HeadManagerContext.Provider>\n </RouterContext.Provider>\n </PathParamsContext.Provider>\n </PathnameContextProviderAdapter>\n </SearchParamsContext.Provider>\n </AppRouterContext.Provider>\n </Container>\n )\n}\n\nconst wrapApp =\n (App: AppComponent) =>\n (wrappedAppProps: Record<string, any>): JSX.Element => {\n const appProps: AppProps = {\n ...wrappedAppProps,\n Component: CachedComponent,\n err: initialData.err,\n router,\n }\n return <AppContainer>{renderApp(App, appProps)}</AppContainer>\n }\n\n// This method handles all runtime and debug errors.\n// 404 and 500 errors are special kind of errors\n// and they are still handle via the main render method.\nfunction renderError(renderErrorProps: RenderErrorProps): Promise<any> {\n let { App, err } = renderErrorProps\n\n // In development runtime errors are caught by our overlay\n // In production we catch runtime errors using componentDidCatch which will trigger renderError\n if (process.env.NODE_ENV !== 'production') {\n // A Next.js rendering runtime error is always unrecoverable\n // FIXME: let's make this recoverable (error in GIP client-transition)\n devClient.onUnrecoverableError()\n\n // We need to render an empty <App> so that the `<ReactDevOverlay>` can\n // render itself.\n // TODO: Fix disabled eslint rule\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return doRender({\n App: () => null,\n props: {},\n Component: () => null,\n styleSheets: [],\n })\n }\n\n // Make sure we log the error to the console, otherwise users can't track down issues.\n console.error(err)\n console.error(\n `A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred`\n )\n\n return pageLoader\n .loadPage('/_error')\n .then(({ page: ErrorComponent, styleSheets }) => {\n return lastAppProps?.Component === ErrorComponent\n ? import('../pages/_error')\n .then((errorModule) => {\n return import('../pages/_app').then((appModule) => {\n App = appModule.default as any as AppComponent\n renderErrorProps.App = App\n return errorModule\n })\n })\n .then((m) => ({\n ErrorComponent: m.default as React.ComponentType<{}>,\n styleSheets: [],\n }))\n : { ErrorComponent, styleSheets }\n })\n .then(({ ErrorComponent, styleSheets }) => {\n // In production we do a normal render with the `ErrorComponent` as component.\n // If we've gotten here upon initial render, we can use the props from the server.\n // Otherwise, we need to call `getInitialProps` on `App` before mounting.\n const AppTree = wrapApp(App)\n const appCtx = {\n Component: ErrorComponent,\n AppTree,\n router,\n ctx: {\n err,\n pathname: initialData.page,\n query: initialData.query,\n asPath,\n AppTree,\n },\n }\n return Promise.resolve(\n renderErrorProps.props?.err\n ? renderErrorProps.props\n : loadGetInitialProps(App, appCtx)\n ).then((initProps) =>\n // TODO: Fix disabled eslint rule\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n doRender({\n ...renderErrorProps,\n err,\n Component: ErrorComponent,\n styleSheets,\n props: initProps,\n })\n )\n })\n}\n\n// Dummy component that we render as a child of Root so that we can\n// toggle the correct styles before the page is rendered.\nfunction Head({ callback }: { callback: () => void }): null {\n // We use `useLayoutEffect` to guarantee the callback is executed\n // as soon as React flushes the update.\n React.useLayoutEffect(() => callback(), [callback])\n return null\n}\n\nconst performanceMarks = {\n navigationStart: 'navigationStart',\n beforeRender: 'beforeRender',\n afterRender: 'afterRender',\n afterHydrate: 'afterHydrate',\n routeChange: 'routeChange',\n} as const\n\nconst performanceMeasures = {\n hydration: 'Next.js-hydration',\n beforeHydration: 'Next.js-before-hydration',\n routeChangeToRender: 'Next.js-route-change-to-render',\n render: 'Next.js-render',\n} as const\n\nlet reactRoot: any = null\n// On initial render a hydrate should always happen\nlet shouldHydrate: boolean = true\n\nfunction clearMarks(): void {\n ;[\n performanceMarks.beforeRender,\n performanceMarks.afterHydrate,\n performanceMarks.afterRender,\n performanceMarks.routeChange,\n ].forEach((mark) => performance.clearMarks(mark))\n}\n\nfunction markHydrateComplete(): void {\n if (!ST) return\n\n performance.mark(performanceMarks.afterHydrate) // mark end of hydration\n\n const hasBeforeRenderMark = performance.getEntriesByName(\n performanceMarks.beforeRender,\n 'mark'\n ).length\n if (hasBeforeRenderMark) {\n const beforeHydrationMeasure = performance.measure(\n performanceMeasures.beforeHydration,\n performanceMarks.navigationStart,\n performanceMarks.beforeRender\n )\n\n const hydrationMeasure = performance.measure(\n performanceMeasures.hydration,\n performanceMarks.beforeRender,\n performanceMarks.afterHydrate\n )\n\n if (\n process.env.NODE_ENV === 'development' &&\n // Old versions of Safari don't return `PerformanceMeasure`s from `performance.measure()`\n beforeHydrationMeasure &&\n hydrationMeasure\n ) {\n tracer\n .startSpan('navigation-to-hydration', {\n startTime: performance.timeOrigin + beforeHydrationMeasure.startTime,\n attributes: {\n pathname: location.pathname,\n query: location.search,\n },\n })\n .end(\n performance.timeOrigin +\n hydrationMeasure.startTime +\n hydrationMeasure.duration\n )\n }\n }\n\n if (onPerfEntry) {\n performance\n .getEntriesByName(performanceMeasures.hydration)\n .forEach(onPerfEntry)\n }\n clearMarks()\n}\n\nfunction markRenderComplete(): void {\n if (!ST) return\n\n performance.mark(performanceMarks.afterRender) // mark end of render\n const navStartEntries: PerformanceEntryList = performance.getEntriesByName(\n performanceMarks.routeChange,\n 'mark'\n )\n\n if (!navStartEntries.length) return\n\n const hasBeforeRenderMark = performance.getEntriesByName(\n performanceMarks.beforeRender,\n 'mark'\n ).length\n\n if (hasBeforeRenderMark) {\n performance.measure(\n performanceMeasures.routeChangeToRender,\n navStartEntries[0].name,\n performanceMarks.beforeRender\n )\n performance.measure(\n performanceMeasures.render,\n performanceMarks.beforeRender,\n performanceMarks.afterRender\n )\n if (onPerfEntry) {\n performance\n .getEntriesByName(performanceMeasures.render)\n .forEach(onPerfEntry)\n performance\n .getEntriesByName(performanceMeasures.routeChangeToRender)\n .forEach(onPerfEntry)\n }\n }\n\n clearMarks()\n ;[\n performanceMeasures.routeChangeToRender,\n performanceMeasures.render,\n ].forEach((measure) => performance.clearMeasures(measure))\n}\n\nfunction renderReactElement(\n domEl: HTMLElement,\n fn: (cb: () => void) => JSX.Element\n): void {\n // mark start of hydrate/render\n if (ST) {\n performance.mark(performanceMarks.beforeRender)\n }\n\n const reactEl = fn(shouldHydrate ? markHydrateComplete : markRenderComplete)\n if (!reactRoot) {\n // Unlike with createRoot, you don't need a separate root.render() call here\n reactRoot = ReactDOM.hydrateRoot(domEl, reactEl, {\n onRecoverableError,\n })\n // TODO: Remove shouldHydrate variable when React 18 is stable as it can depend on `reactRoot` existing\n shouldHydrate = false\n } else {\n const startTransition = (React as any).startTransition\n startTransition(() => {\n reactRoot.render(reactEl)\n })\n }\n}\n\nfunction Root({\n callbacks,\n children,\n}: React.PropsWithChildren<{\n callbacks: Array<() => void>\n}>): React.ReactElement {\n // We use `useLayoutEffect` to guarantee the callbacks are executed\n // as soon as React flushes the update\n React.useLayoutEffect(\n () => callbacks.forEach((callback) => callback()),\n [callbacks]\n )\n\n if (process.env.__NEXT_TEST_MODE) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n window.__NEXT_HYDRATED = true\n\n if (window.__NEXT_HYDRATED_CB) {\n window.__NEXT_HYDRATED_CB()\n }\n }, [])\n }\n\n return children as React.ReactElement\n}\n\nfunction doRender(input: RenderRouteInfo): Promise<any> {\n let { App, Component, props, err }: RenderRouteInfo = input\n let styleSheets: StyleSheetTuple[] | undefined =\n 'initial' in input ? undefined : input.styleSheets\n Component = Component || lastAppProps.Component\n props = props || lastAppProps.props\n\n const appProps: AppProps = {\n ...props,\n Component,\n err,\n router,\n }\n // lastAppProps has to be set before ReactDom.render to account for ReactDom throwing an error.\n lastAppProps = appProps\n\n let canceled: boolean = false\n let resolvePromise: () => void\n const renderPromise = new Promise<void>((resolve, reject) => {\n if (lastRenderReject) {\n lastRenderReject()\n }\n resolvePromise = () => {\n lastRenderReject = null\n resolve()\n }\n lastRenderReject = () => {\n canceled = true\n lastRenderReject = null\n\n const error: any = new Error('Cancel rendering route')\n error.cancelled = true\n reject(error)\n }\n })\n\n // This function has a return type to ensure it doesn't start returning a\n // Promise. It should remain synchronous.\n function onStart(): boolean {\n if (\n !styleSheets ||\n // We use `style-loader` in development, so we don't need to do anything\n // unless we're in production:\n process.env.NODE_ENV !== 'production'\n ) {\n return false\n }\n\n const currentStyleTags: HTMLStyleElement[] = looseToArray<HTMLStyleElement>(\n document.querySelectorAll('style[data-n-href]')\n )\n const currentHrefs: Set<string | null> = new Set(\n currentStyleTags.map((tag) => tag.getAttribute('data-n-href'))\n )\n\n const noscript: Element | null = document.querySelector(\n 'noscript[data-n-css]'\n )\n const nonce: string | null | undefined =\n noscript?.getAttribute('data-n-css')\n\n styleSheets.forEach(({ href, text }: { href: string; text: any }) => {\n if (!currentHrefs.has(href)) {\n const styleTag = document.createElement('style')\n styleTag.setAttribute('data-n-href', href)\n styleTag.setAttribute('media', 'x')\n\n if (nonce) {\n styleTag.setAttribute('nonce', nonce)\n }\n\n document.head.appendChild(styleTag)\n styleTag.appendChild(document.createTextNode(text))\n }\n })\n return true\n }\n\n function onHeadCommit(): void {\n if (\n // Turbopack has it's own css injection handling, this code ends up removing the CSS.\n !process.env.TURBOPACK &&\n // We use `style-loader` in development, so we don't need to do anything\n // unless we're in production:\n process.env.NODE_ENV === 'production' &&\n // We can skip this during hydration. Running it wont cause any harm, but\n // we may as well save the CPU cycles:\n styleSheets &&\n // Ensure this render was not canceled\n !canceled\n ) {\n const desiredHrefs: Set<string> = new Set(styleSheets.map((s) => s.href))\n const currentStyleTags: HTMLStyleElement[] =\n looseToArray<HTMLStyleElement>(\n document.querySelectorAll('style[data-n-href]')\n )\n const currentHrefs: string[] = currentStyleTags.map(\n (tag) => tag.getAttribute('data-n-href')!\n )\n\n // Toggle `<style>` tags on or off depending on if they're needed:\n for (let idx = 0; idx < currentHrefs.length; ++idx) {\n if (desiredHrefs.has(currentHrefs[idx])) {\n currentStyleTags[idx].removeAttribute('media')\n } else {\n currentStyleTags[idx].setAttribute('media', 'x')\n }\n }\n\n // Reorder styles into intended order:\n let referenceNode: Element | null = document.querySelector(\n 'noscript[data-n-css]'\n )\n if (\n // This should be an invariant:\n referenceNode\n ) {\n styleSheets.forEach(({ href }: { href: string }) => {\n const targetTag: Element | null = document.querySelector(\n `style[data-n-href=\"${href}\"]`\n )\n if (\n // This should be an invariant:\n targetTag\n ) {\n referenceNode!.parentNode!.insertBefore(\n targetTag,\n referenceNode!.nextSibling\n )\n referenceNode = targetTag\n }\n })\n }\n\n // Finally, clean up server rendered stylesheets:\n looseToArray<HTMLLinkElement>(\n document.querySelectorAll('link[data-n-p]')\n ).forEach((el) => {\n el.parentNode!.removeChild(el)\n })\n }\n\n if (input.scroll) {\n const { x, y } = input.scroll\n handleSmoothScroll(() => {\n window.scrollTo(x, y)\n })\n }\n }\n\n function onRootCommit(): void {\n resolvePromise()\n }\n\n onStart()\n\n const elem: JSX.Element = (\n <>\n <Head callback={onHeadCommit} />\n <AppContainer>\n {renderApp(App, appProps)}\n <Portal type=\"next-route-announcer\">\n <RouteAnnouncer />\n </Portal>\n </AppContainer>\n </>\n )\n\n // We catch runtime errors using componentDidCatch which will trigger renderError\n renderReactElement(appElement!, (callback) => (\n <Root callbacks={[callback, onRootCommit]}>\n {process.env.__NEXT_STRICT_MODE ? (\n <React.StrictMode>{elem}</React.StrictMode>\n ) : (\n elem\n )}\n </Root>\n ))\n\n return renderPromise\n}\n\nasync function render(renderingProps: RenderRouteInfo): Promise<void> {\n // if an error occurs in a server-side page (e.g. in getInitialProps),\n // skip re-rendering the error page client-side as data-fetching operations\n // will already have been done on the server and NEXT_DATA contains the correct\n // data for straight-forward hydration of the error page\n if (\n renderingProps.err &&\n // renderingProps.Component might be undefined if there is a top/module-level error\n (typeof renderingProps.Component === 'undefined' ||\n !renderingProps.isHydratePass)\n ) {\n await renderError(renderingProps)\n return\n }\n\n try {\n await doRender(renderingProps)\n } catch (err) {\n const renderErr = getProperError(err)\n // bubble up cancelation errors\n if ((renderErr as Error & { cancelled?: boolean }).cancelled) {\n throw renderErr\n }\n\n if (process.env.NODE_ENV === 'development') {\n // Ensure this error is displayed in the overlay in development\n setTimeout(() => {\n throw renderErr\n })\n }\n await renderError({ ...renderingProps, err: renderErr })\n }\n}\n\nexport async function hydrate(opts?: { beforeRender?: () => Promise<void> }) {\n let initialErr = initialData.err\n\n try {\n const appEntrypoint = await pageLoader.routeLoader.whenEntrypoint('/_app')\n if ('error' in appEntrypoint) {\n throw appEntrypoint.error\n }\n\n const { component: app, exports: mod } = appEntrypoint\n CachedApp = app as AppComponent\n if (mod && mod.reportWebVitals) {\n onPerfEntry = ({\n id,\n name,\n startTime,\n value,\n duration,\n entryType,\n entries,\n attribution,\n }: any): void => {\n // Combines timestamp with random number for unique ID\n const uniqueID: string = `${Date.now()}-${\n Math.floor(Math.random() * (9e12 - 1)) + 1e12\n }`\n let perfStartEntry: string | undefined\n\n if (entries && entries.length) {\n perfStartEntry = entries[0].startTime\n }\n\n const webVitals: NextWebVitalsMetric = {\n id: id || uniqueID,\n name,\n startTime: startTime || perfStartEntry,\n value: value == null ? duration : value,\n label:\n entryType === 'mark' || entryType === 'measure'\n ? 'custom'\n : 'web-vital',\n }\n if (attribution) {\n webVitals.attribution = attribution\n }\n mod.reportWebVitals(webVitals)\n }\n }\n\n const pageEntrypoint =\n // The dev server fails to serve script assets when there's a hydration\n // error, so we need to skip waiting for the entrypoint.\n process.env.NODE_ENV === 'development' && initialData.err\n ? { error: initialData.err }\n : await pageLoader.routeLoader.whenEntrypoint(initialData.page)\n if ('error' in pageEntrypoint) {\n throw pageEntrypoint.error\n }\n CachedComponent = pageEntrypoint.component\n\n if (process.env.NODE_ENV !== 'production') {\n const { isValidElementType } = require('next/dist/compiled/react-is')\n if (!isValidElementType(CachedComponent)) {\n throw new Error(\n `The default export is not a React Component in page: \"${initialData.page}\"`\n )\n }\n }\n } catch (error) {\n // This catches errors like throwing in the top level of a module\n initialErr = getProperError(error)\n }\n\n if (process.env.NODE_ENV === 'development') {\n const getServerError: typeof import('./components/react-dev-overlay/pages/client').getServerError =\n require('./components/react-dev-overlay/pages/client').getServerError\n // Server-side runtime errors need to be re-thrown on the client-side so\n // that the overlay is rendered.\n if (initialErr) {\n if (initialErr === initialData.err) {\n setTimeout(() => {\n let error\n try {\n // Generate a new error object. We `throw` it because some browsers\n // will set the `stack` when thrown, and we want to ensure ours is\n // not overridden when we re-throw it below.\n throw new Error(initialErr!.message)\n } catch (e) {\n error = e as Error\n }\n\n error.name = initialErr!.name\n error.stack = initialErr!.stack\n const errSource = initialErr.source!\n\n // In development, error the navigation API usage in runtime,\n // since it's not allowed to be used in pages router as it doesn't contain error boundary like app router.\n if (isNextRouterError(initialErr)) {\n error.message =\n 'Next.js navigation API is not allowed to be used in Pages Router.'\n }\n\n throw getServerError(error, errSource)\n })\n }\n // We replaced the server-side error with a client-side error, and should\n // no longer rewrite the stack trace to a Node error.\n else {\n setTimeout(() => {\n throw initialErr\n })\n }\n }\n }\n\n if (window.__NEXT_PRELOADREADY) {\n await window.__NEXT_PRELOADREADY(initialData.dynamicIds)\n }\n\n router = createRouter(initialData.page, initialData.query, asPath, {\n initialProps: initialData.props,\n pageLoader,\n App: CachedApp,\n Component: CachedComponent,\n wrapApp,\n err: initialErr,\n isFallback: Boolean(initialData.isFallback),\n subscription: (info, App, scroll) =>\n render(\n Object.assign<\n {},\n Omit<RenderRouteInfo, 'App' | 'scroll'>,\n Pick<RenderRouteInfo, 'App' | 'scroll'>\n >({}, info, {\n App,\n scroll,\n }) as RenderRouteInfo\n ),\n locale: initialData.locale,\n locales: initialData.locales,\n defaultLocale,\n domainLocales: initialData.domainLocales,\n isPreview: initialData.isPreview,\n })\n\n initialMatchesMiddleware = await router._initialMatchesMiddlewarePromise\n\n const renderCtx: RenderRouteInfo = {\n App: CachedApp,\n initial: true,\n Component: CachedComponent,\n props: initialData.props,\n err: initialErr,\n isHydratePass: true,\n }\n\n if (opts?.beforeRender) {\n await opts.beforeRender()\n }\n\n render(renderCtx)\n}\n"],"names":["React","ReactDOM","HeadManagerContext","mitt","RouterContext","handleSmoothScroll","isDynamicRoute","urlQueryToSearchParams","assign","setConfig","getURL","loadGetInitialProps","ST","Portal","initHeadManager","PageLoader","RouteAnnouncer","createRouter","makePublicRouterInstance","getProperError","ImageConfigContext","removeBasePath","hasBasePath","AppRouterContext","adaptForAppRouterInstance","adaptForPathParams","adaptForSearchParams","PathnameContextProviderAdapter","SearchParamsContext","PathParamsContext","onRecoverableError","tracer","isNextRouterError","version","process","env","__NEXT_VERSION","router","emitter","looseToArray","input","slice","call","initialData","defaultLocale","undefined","asPath","pageLoader","appElement","headManager","initialMatchesMiddleware","lastAppProps","lastRenderReject","devClient","CachedApp","onPerfEntry","CachedComponent","Container","Component","componentDidCatch","componentErr","info","props","fn","componentDidMount","scrollToHash","isSsr","isFallback","nextExport","pathname","location","search","__NEXT_HAS_REWRITES","__N_SSG","replace","String","query","URLSearchParams","_h","shallow","catch","err","cancelled","componentDidUpdate","hash","substring","el","document","getElementById","setTimeout","scrollIntoView","render","NODE_ENV","children","ReactDevOverlay","require","initialize","opts","onSpanEnd","default","JSON","parse","textContent","window","__NEXT_DATA__","prefix","assetPrefix","self","__next_set_public_path__","serverRuntimeConfig","publicRuntimeConfig","runtimeConfig","__NEXT_I18N_SUPPORT","normalizeLocalePath","detectDomainLocale","parseRelativeUrl","formatUrl","locales","parsedAs","localePathResult","detectedLocale","locale","detectedDomain","__NEXT_I18N_DOMAINS","hostname","scriptLoader","initScriptLoader","buildId","register","r","f","routeLoader","onEntrypoint","__NEXT_P","map","p","push","getIsSsr","renderApp","App","appProps","AppContainer","adaptedForAppRouter","useMemo","error","renderError","console","Provider","value","isAutoExport","autoExport","__NEXT_IMAGE_OPTS","wrapApp","wrappedAppProps","renderErrorProps","onUnrecoverableError","doRender","styleSheets","loadPage","then","page","ErrorComponent","errorModule","appModule","m","AppTree","appCtx","ctx","Promise","resolve","initProps","Head","callback","useLayoutEffect","performanceMarks","navigationStart","beforeRender","afterRender","afterHydrate","routeChange","performanceMeasures","hydration","beforeHydration","routeChangeToRender","reactRoot","shouldHydrate","clearMarks","forEach","mark","performance","markHydrateComplete","hasBeforeRenderMark","getEntriesByName","length","beforeHydrationMeasure","measure","hydrationMeasure","startSpan","startTime","timeOrigin","attributes","end","duration","markRenderComplete","navStartEntries","name","clearMeasures","renderReactElement","domEl","reactEl","hydrateRoot","startTransition","Root","callbacks","__NEXT_TEST_MODE","useEffect","__NEXT_HYDRATED","__NEXT_HYDRATED_CB","canceled","resolvePromise","renderPromise","reject","Error","onStart","currentStyleTags","querySelectorAll","currentHrefs","Set","tag","getAttribute","noscript","querySelector","nonce","href","text","has","styleTag","createElement","setAttribute","head","appendChild","createTextNode","onHeadCommit","TURBOPACK","desiredHrefs","s","idx","removeAttribute","referenceNode","targetTag","parentNode","insertBefore","nextSibling","removeChild","scroll","x","y","scrollTo","onRootCommit","elem","type","__NEXT_STRICT_MODE","StrictMode","renderingProps","isHydratePass","renderErr","hydrate","initialErr","appEntrypoint","whenEntrypoint","component","app","exports","mod","reportWebVitals","id","entryType","entries","attribution","uniqueID","Date","now","Math","floor","random","perfStartEntry","webVitals","label","pageEntrypoint","isValidElementType","getServerError","message","e","stack","errSource","source","__NEXT_PRELOADREADY","dynamicIds","initialProps","Boolean","subscription","Object","domainLocales","isPreview","_initialMatchesMiddlewarePromise","renderCtx","initial"],"mappings":"AAAA,mBAAmB,GACnB,6DAA6D;;AAC7D,OAAO,qCAAoC;AAQ3C,OAAOA,WAAyB,QAAO;AACvC,OAAOC,cAAc,mBAAkB;AACvC,SAASC,kBAAkB,QAAQ,oDAAmD;AACtF,OAAOC,UAAU,qBAAoB;AAErC,SAASC,aAAa,QAAQ,8CAA6C;AAC3E,SAASC,kBAAkB,QAAQ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