next 15.4.0-canary.48 → 15.4.0-canary.49

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.
Files changed (50) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/index.js +2 -2
  3. package/dist/build/swc/index.js +1 -1
  4. package/dist/build/webpack-config.js +6 -2
  5. package/dist/build/webpack-config.js.map +1 -1
  6. package/dist/client/app-bootstrap.js +1 -1
  7. package/dist/client/components/react-dev-overlay/utils/launch-editor.d.ts +2 -2
  8. package/dist/client/components/react-dev-overlay/utils/launch-editor.js +30 -7
  9. package/dist/client/components/react-dev-overlay/utils/launch-editor.js.map +1 -1
  10. package/dist/client/index.js +1 -1
  11. package/dist/compiled/next-server/app-page-experimental.runtime.dev.js +2 -2
  12. package/dist/compiled/next-server/app-page-turbo-experimental.runtime.dev.js +2 -2
  13. package/dist/compiled/next-server/app-page-turbo.runtime.dev.js +2 -2
  14. package/dist/compiled/next-server/app-page.runtime.dev.js +2 -2
  15. package/dist/compiled/next-server/pages-api.runtime.dev.js +1 -1
  16. package/dist/compiled/next-server/pages-api.runtime.dev.js.map +1 -1
  17. package/dist/compiled/next-server/pages.runtime.dev.js +2 -2
  18. package/dist/compiled/next-server/pages.runtime.dev.js.map +1 -1
  19. package/dist/compiled/next-server/server.runtime.prod.js +1 -1
  20. package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
  21. package/dist/esm/build/index.js +2 -2
  22. package/dist/esm/build/swc/index.js +1 -1
  23. package/dist/esm/build/webpack-config.js +6 -2
  24. package/dist/esm/build/webpack-config.js.map +1 -1
  25. package/dist/esm/client/app-bootstrap.js +1 -1
  26. package/dist/esm/client/components/react-dev-overlay/utils/launch-editor.js +16 -6
  27. package/dist/esm/client/components/react-dev-overlay/utils/launch-editor.js.map +1 -1
  28. package/dist/esm/client/index.js +1 -1
  29. package/dist/esm/export/worker.js +8 -0
  30. package/dist/esm/export/worker.js.map +1 -1
  31. package/dist/esm/server/base-server.js +8 -4
  32. package/dist/esm/server/base-server.js.map +1 -1
  33. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  34. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  35. package/dist/esm/server/lib/app-info-log.js +1 -1
  36. package/dist/esm/server/lib/start-server.js +1 -1
  37. package/dist/esm/shared/lib/canary-only.js +1 -1
  38. package/dist/export/worker.js +8 -0
  39. package/dist/export/worker.js.map +1 -1
  40. package/dist/server/base-server.js +7 -3
  41. package/dist/server/base-server.js.map +1 -1
  42. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  43. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  44. package/dist/server/lib/app-info-log.js +1 -1
  45. package/dist/server/lib/start-server.js +1 -1
  46. package/dist/shared/lib/canary-only.js +1 -1
  47. package/dist/telemetry/anonymous-meta.js +1 -1
  48. package/dist/telemetry/events/session-stopped.js +2 -2
  49. package/dist/telemetry/events/version.js +2 -2
  50. package/package.json +15 -15
@@ -3,7 +3,7 @@
3
3
  * sure the following scripts are executed in the correct order:
4
4
  * - Polyfills
5
5
  * - next/script with `beforeInteractive` strategy
6
- */ const version = "15.4.0-canary.48";
6
+ */ const version = "15.4.0-canary.49";
7
7
  window.next = {
8
8
  version,
9
9
  appDir: true
@@ -298,7 +298,17 @@ function printInstructions(fileName, errorMessage) {
298
298
  console.log('To set up the editor integration, add something like ' + cyan('REACT_EDITOR=atom') + ' to the ' + green('.env.local') + ' file in your project folder ' + 'and restart the development server.');
299
299
  console.log();
300
300
  }
301
- function launchEditor(fileName, lineNumber, colNumber) {
301
+ export function escapeApplescriptStringFragment(input) {
302
+ // The only two special characters in a quoted applescript string are
303
+ // backslash and double quote. Both are escaped with a preceeding backslash.
304
+ //
305
+ // Some whitespace characters (like newlines) can be escaped (as `\n`), but
306
+ // aren't required to be escaped (so we're not bothering to do that).
307
+ //
308
+ // https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_classes.html#//apple_ref/doc/uid/TP40000983-CH1g-BBCIAHJF:~:text=Special%20String%20Characters
309
+ return input.replaceAll(/[\\"]/g, (original)=>"\\" + original);
310
+ }
311
+ export function launchEditor(fileName, lineNumber, colNumber) {
302
312
  if (!fs.existsSync(fileName)) {
303
313
  return;
304
314
  }
@@ -360,12 +370,13 @@ function launchEditor(fileName, lineNumber, colNumber) {
360
370
  });
361
371
  } else if (isTerminalEditor(editor)) {
362
372
  if (process.platform === 'darwin') {
373
+ const escapedScript = escapeApplescriptStringFragment(shellQuote.quote([
374
+ editor,
375
+ ...args
376
+ ]));
363
377
  p = child_process.spawn('osascript', [
364
378
  '-e',
365
- 'tell application "Terminal" to do script "' + shellQuote.quote([
366
- editor,
367
- ...args
368
- ]) + '"'
379
+ 'tell application "Terminal" to do script "' + escapedScript + '"'
369
380
  ], {
370
381
  stdio: 'ignore'
371
382
  });
@@ -388,6 +399,5 @@ function launchEditor(fileName, lineNumber, colNumber) {
388
399
  });
389
400
  }
390
401
  }
391
- export { launchEditor };
392
402
 
393
403
  //# sourceMappingURL=launch-editor.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/client/components/react-dev-overlay/utils/launch-editor.ts"],"sourcesContent":["/**\n * MIT License\n *\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nimport { cyan, green, red } from '../../../../lib/picocolors'\nimport child_process from 'child_process'\nimport fs from 'fs'\nimport os from 'os'\nimport path from 'path'\nimport shellQuote from 'next/dist/compiled/shell-quote'\n\nfunction isTerminalEditor(editor: string) {\n switch (editor) {\n case 'vi':\n case 'vim':\n case 'nvim':\n case 'emacs':\n case 'nano': {\n return true\n }\n default: {\n }\n }\n return false\n}\n\n// Map from full process name to binary that starts the process\n// We can't just re-use full process name, because it will spawn a new instance\n// of the app every time\nconst COMMON_EDITORS_MACOS = {\n '/Applications/Atom.app/Contents/MacOS/Atom': 'atom',\n '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta':\n '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta',\n '/Applications/Brackets.app/Contents/MacOS/Brackets': 'brackets',\n '/Applications/Sublime Text.app/Contents/MacOS/Sublime Text':\n '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',\n '/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text':\n '/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl',\n '/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2':\n '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl',\n '/Applications/Visual Studio Code.app/Contents/MacOS/Electron':\n '/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code',\n '/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron':\n '/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code',\n '/Applications/VSCodium.app/Contents/MacOS/Electron':\n '/Applications/VSCodium.app/Contents/Resources/app/bin/code',\n '/Applications/AppCode.app/Contents/MacOS/appcode':\n '/Applications/AppCode.app/Contents/MacOS/appcode',\n '/Applications/CLion.app/Contents/MacOS/clion':\n '/Applications/CLion.app/Contents/MacOS/clion',\n '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea':\n '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea',\n '/Applications/PhpStorm.app/Contents/MacOS/phpstorm':\n '/Applications/PhpStorm.app/Contents/MacOS/phpstorm',\n '/Applications/PyCharm.app/Contents/MacOS/pycharm':\n '/Applications/PyCharm.app/Contents/MacOS/pycharm',\n '/Applications/PyCharm CE.app/Contents/MacOS/pycharm':\n '/Applications/PyCharm CE.app/Contents/MacOS/pycharm',\n '/Applications/RubyMine.app/Contents/MacOS/rubymine':\n '/Applications/RubyMine.app/Contents/MacOS/rubymine',\n '/Applications/WebStorm.app/Contents/MacOS/webstorm':\n '/Applications/WebStorm.app/Contents/MacOS/webstorm',\n '/Applications/MacVim.app/Contents/MacOS/MacVim': 'mvim',\n '/Applications/GoLand.app/Contents/MacOS/goland':\n '/Applications/GoLand.app/Contents/MacOS/goland',\n '/Applications/Rider.app/Contents/MacOS/rider':\n '/Applications/Rider.app/Contents/MacOS/rider',\n '/Applications/Cursor.app/Contents/MacOS/Cursor':\n '/Applications/Cursor.app/Contents/MacOS/Cursor',\n}\n\nconst COMMON_EDITORS_LINUX = {\n atom: 'atom',\n Brackets: 'brackets',\n code: 'code',\n 'code-insiders': 'code-insiders',\n vscodium: 'vscodium',\n emacs: 'emacs',\n gvim: 'gvim',\n 'idea.sh': 'idea',\n 'phpstorm.sh': 'phpstorm',\n 'pycharm.sh': 'pycharm',\n 'rubymine.sh': 'rubymine',\n sublime_text: 'sublime_text',\n vim: 'vim',\n nvim: 'nvim',\n 'webstorm.sh': 'webstorm',\n 'goland.sh': 'goland',\n 'rider.sh': 'rider',\n}\n\nconst COMMON_EDITORS_WIN = [\n 'Brackets.exe',\n 'Code.exe',\n 'Code - Insiders.exe',\n 'VSCodium.exe',\n 'atom.exe',\n 'sublime_text.exe',\n 'notepad++.exe',\n 'clion.exe',\n 'clion64.exe',\n 'idea.exe',\n 'idea64.exe',\n 'phpstorm.exe',\n 'phpstorm64.exe',\n 'pycharm.exe',\n 'pycharm64.exe',\n 'rubymine.exe',\n 'rubymine64.exe',\n 'webstorm.exe',\n 'webstorm64.exe',\n 'goland.exe',\n 'goland64.exe',\n 'rider.exe',\n 'rider64.exe',\n]\n\n// Transpiled version of: /^([A-Za-z]:[/\\\\])?[\\p{L}0-9/.\\-_\\\\]+$/u\n// Non-transpiled version requires support for Unicode property regex. Allows\n// alphanumeric characters, periods, dashes, slashes, and underscores.\nconst WINDOWS_FILE_NAME_ACCESS_LIST =\n /^([A-Za-z]:[/\\\\])?(?:[\\x2D-9A-Z\\\\_a-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0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\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEF\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7B9\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\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\uDE86-\\uDE89\\uDE9D\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF44\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1]|\\uD821[\\uDC00-\\uDFF1]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00-\\uDD1E\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D])+$/\n\nfunction getArgumentsForLineNumber(\n editor: string,\n fileName: string,\n lineNumber: number,\n colNumber: number\n): string[] {\n const editorBasename = path.basename(editor).replace(/\\.(exe|cmd|bat)$/i, '')\n switch (editorBasename) {\n case 'atom':\n case 'Atom':\n case 'Atom Beta':\n case 'subl':\n case 'sublime':\n case 'sublime_text': {\n return [fileName + ':' + lineNumber + ':' + colNumber]\n }\n case 'wstorm':\n case 'charm': {\n return [fileName + ':' + lineNumber]\n }\n case 'notepad++': {\n return ['-n' + lineNumber, '-c' + colNumber, fileName]\n }\n case 'vim':\n case 'nvim':\n case 'mvim':\n case 'joe':\n case 'gvim': {\n return ['+' + lineNumber, fileName]\n }\n case 'emacs':\n case 'emacsclient': {\n return ['+' + lineNumber + ':' + colNumber, fileName]\n }\n case 'rmate':\n case 'mate':\n case 'mine': {\n return ['--line', lineNumber.toString(), fileName]\n }\n case 'code':\n case 'Code':\n case 'Cursor':\n case 'code-insiders':\n case 'Code - Insiders':\n case 'vscodium':\n case 'VSCodium': {\n return ['-g', fileName + ':' + lineNumber + ':' + colNumber]\n }\n case 'appcode':\n case 'clion':\n case 'clion64':\n case 'idea':\n case 'idea64':\n case 'phpstorm':\n case 'phpstorm64':\n case 'pycharm':\n case 'pycharm64':\n case 'rubymine':\n case 'rubymine64':\n case 'webstorm':\n case 'webstorm64':\n case 'goland':\n case 'goland64':\n case 'rider':\n case 'rider64': {\n return ['--line', lineNumber.toString(), fileName]\n }\n default: {\n // For all others, drop the lineNumber until we have\n // a mapping above, since providing the lineNumber incorrectly\n // can result in errors or confusing behavior.\n return [fileName]\n }\n }\n}\n\nfunction guessEditor(): string[] {\n // Explicit config always wins\n if (process.env.REACT_EDITOR) {\n return shellQuote.parse(process.env.REACT_EDITOR) as any\n }\n\n // We can find out which editor is currently running by:\n // `ps x` on macOS and Linux\n // `Get-Process` on Windows\n try {\n if (process.platform === 'darwin') {\n const output = child_process.execSync('ps x').toString()\n const processNames = Object.keys(COMMON_EDITORS_MACOS)\n for (let i = 0; i < processNames.length; i++) {\n const processName = processNames[i]\n if (output.indexOf(processName) !== -1) {\n return [(COMMON_EDITORS_MACOS as any)[processName]]\n }\n }\n } else if (process.platform === 'win32') {\n // Some processes need elevated rights to get its executable path.\n // Just filter them out upfront. This also saves 10-20ms on the command.\n const output = child_process\n .execSync(\n 'wmic process where \"executablepath is not null\" get executablepath'\n )\n .toString()\n const runningProcesses = output.split('\\r\\n')\n for (let i = 0; i < runningProcesses.length; i++) {\n const processPath = runningProcesses[i].trim()\n const processName = path.basename(processPath)\n if (COMMON_EDITORS_WIN.indexOf(processName) !== -1) {\n return [processPath]\n }\n }\n } else if (process.platform === 'linux') {\n // --no-heading No header line\n // x List all processes owned by you\n // -o comm Need only names column\n const output = child_process\n .execSync('ps x --no-heading -o comm --sort=comm')\n .toString()\n const processNames = Object.keys(COMMON_EDITORS_LINUX)\n for (let i = 0; i < processNames.length; i++) {\n const processName = processNames[i]\n if (output.indexOf(processName) !== -1) {\n return [(COMMON_EDITORS_LINUX as any)[processName] as string]\n }\n }\n }\n } catch (error) {\n // Ignore...\n }\n\n // Last resort, use old skool env vars\n if (process.env.VISUAL) {\n return [process.env.VISUAL]\n } else if (process.env.EDITOR) {\n return [process.env.EDITOR]\n }\n\n return []\n}\n\nfunction printInstructions(fileName: string, errorMessage: string | null) {\n console.log()\n console.log(\n red('Could not open ' + path.basename(fileName) + ' in the editor.')\n )\n if (errorMessage) {\n if (errorMessage[errorMessage.length - 1] !== '.') {\n errorMessage += '.'\n }\n console.log(red('The editor process exited with an error: ' + errorMessage))\n }\n console.log()\n console.log(\n 'To set up the editor integration, add something like ' +\n cyan('REACT_EDITOR=atom') +\n ' to the ' +\n green('.env.local') +\n ' file in your project folder ' +\n 'and restart the development server.'\n )\n console.log()\n}\n\nfunction launchEditor(fileName: string, lineNumber: number, colNumber: number) {\n if (!fs.existsSync(fileName)) {\n return\n }\n\n // Sanitize lineNumber to prevent malicious use on win32\n // via: https://github.com/nodejs/node/blob/c3bb4b1aa5e907d489619fb43d233c3336bfc03d/lib/child_process.js#L333\n // and it should be a positive integer\n if (!(Number.isInteger(lineNumber) && lineNumber > 0)) {\n return\n }\n\n // colNumber is optional, but should be a positive integer too\n // default is 1\n if (!(Number.isInteger(colNumber) && colNumber > 0)) {\n colNumber = 1\n }\n\n let [editor, ...args] = guessEditor()\n\n if (!editor) {\n printInstructions(fileName, null)\n return\n }\n\n if (editor.toLowerCase() === 'none') {\n return\n }\n\n if (\n process.platform === 'linux' &&\n fileName.startsWith('/mnt/') &&\n /Microsoft/i.test(os.release())\n ) {\n // Assume WSL / \"Bash on Ubuntu on Windows\" is being used, and\n // that the file exists on the Windows file system.\n // `os.release()` is \"4.4.0-43-Microsoft\" in the current release\n // build of WSL, see: https://github.com/Microsoft/BashOnWindows/issues/423#issuecomment-221627364\n // When a Windows editor is specified, interop functionality can\n // handle the path translation, but only if a relative path is used.\n fileName = path.relative('', fileName)\n }\n\n // cmd.exe on Windows is vulnerable to RCE attacks given a file name of the\n // form \"C:\\Users\\myusername\\Downloads\\& curl 172.21.93.52\". Use an access list\n // to validate user-provided file names. This doesn't cover the entire range\n // of valid file names but should cover almost all of them in practice.\n if (\n process.platform === 'win32' &&\n !WINDOWS_FILE_NAME_ACCESS_LIST.test(fileName.trim())\n ) {\n console.log()\n console.log(\n red('Could not open ' + path.basename(fileName) + ' in the editor.')\n )\n console.log()\n console.log(\n 'When running on Windows, file names are checked against an access list ' +\n 'to protect against remote code execution attacks. File names may ' +\n 'consist only of alphanumeric characters (all languages), periods, ' +\n 'dashes, slashes, and underscores.'\n )\n console.log()\n return\n }\n\n if (lineNumber) {\n args = args.concat(\n getArgumentsForLineNumber(editor, fileName, lineNumber, colNumber)\n )\n } else {\n args.push(fileName)\n }\n\n let p: child_process.ChildProcess | undefined = undefined\n if (process.platform === 'win32') {\n // On Windows, launch the editor in a shell because spawn can only\n // launch .exe files.\n p = child_process.spawn('cmd.exe', ['/C', editor].concat(args), {\n stdio: 'inherit',\n detached: true,\n })\n } else if (isTerminalEditor(editor)) {\n if (process.platform === 'darwin') {\n p = child_process.spawn(\n 'osascript',\n [\n '-e',\n `tell application \"Terminal\" to do script \"${shellQuote.quote([\n editor,\n ...args,\n ])}\"`,\n ],\n { stdio: 'ignore' }\n )\n } else {\n printInstructions(fileName, 'Terminal editors can only be used on macOS.')\n }\n } else {\n p = child_process.spawn(editor, args, { stdio: 'inherit' })\n }\n\n if (p) {\n p.on('exit', function (errorCode) {\n if (errorCode) {\n printInstructions(fileName, '(code ' + errorCode + ')')\n }\n })\n p.on('error', function (error) {\n printInstructions(fileName, error.message)\n })\n }\n}\n\nexport { launchEditor }\n"],"names":["cyan","green","red","child_process","fs","os","path","shellQuote","isTerminalEditor","editor","COMMON_EDITORS_MACOS","COMMON_EDITORS_LINUX","atom","Brackets","code","vscodium","emacs","gvim","sublime_text","vim","nvim","COMMON_EDITORS_WIN","WINDOWS_FILE_NAME_ACCESS_LIST","getArgumentsForLineNumber","fileName","lineNumber","colNumber","editorBasename","basename","replace","toString","guessEditor","process","env","REACT_EDITOR","parse","platform","output","execSync","processNames","Object","keys","i","length","processName","indexOf","runningProcesses","split","processPath","trim","error","VISUAL","EDITOR","printInstructions","errorMessage","console","log","launchEditor","existsSync","Number","isInteger","args","toLowerCase","startsWith","test","release","relative","concat","push","p","undefined","spawn","stdio","detached","quote","on","errorCode","message"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,SAASA,IAAI,EAAEC,KAAK,EAAEC,GAAG,QAAQ,6BAA4B;AAC7D,OAAOC,mBAAmB,gBAAe;AACzC,OAAOC,QAAQ,KAAI;AACnB,OAAOC,QAAQ,KAAI;AACnB,OAAOC,UAAU,OAAM;AACvB,OAAOC,gBAAgB,iCAAgC;AAEvD,SAASC,iBAAiBC,MAAc;IACtC,OAAQA;QACN,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;YAAQ;gBACX,OAAO;YACT;QACA;YAAS,CACT;IACF;IACA,OAAO;AACT;AAEA,+DAA+D;AAC/D,+EAA+E;AAC/E,wBAAwB;AACxB,MAAMC,uBAAuB;IAC3B,8CAA8C;IAC9C,wDACE;IACF,sDAAsD;IACtD,8DACE;IACF,kEACE;IACF,kEACE;IACF,gEACE;IACF,2EACE;IACF,sDACE;IACF,oDACE;IACF,gDACE;IACF,uDACE;IACF,sDACE;IACF,oDACE;IACF,uDACE;IACF,sDACE;IACF,sDACE;IACF,kDAAkD;IAClD,kDACE;IACF,gDACE;IACF,kDACE;AACJ;AAEA,MAAMC,uBAAuB;IAC3BC,MAAM;IACNC,UAAU;IACVC,MAAM;IACN,iBAAiB;IACjBC,UAAU;IACVC,OAAO;IACPC,MAAM;IACN,WAAW;IACX,eA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4CC;IAChD,IAAItC,QAAQI,QAAQ,KAAK,SAAS;QAChC,kEAAkE;QAClE,qBAAqB;QACrBiC,IAAIlE,cAAcoE,KAAK,CAAC,WAAW;YAAC;YAAM9D;SAAO,CAAC0D,MAAM,CAACN,OAAO;YAC9DW,OAAO;YACPC,UAAU;QACZ;IACF,OAAO,IAAIjE,iBAAiBC,SAAS;QACnC,IAAIuB,QAAQI,QAAQ,KAAK,UAAU;YACjCiC,IAAIlE,cAAcoE,KAAK,CACrB,aACA;gBACE;gBACC,+CAA4ChE,WAAWmE,KAAK,CAAC;oBAC5DjE;uBACGoD;iBACJ,IAAE;aACJ,EACD;gBAAEW,OAAO;YAAS;QAEtB,OAAO;YACLnB,kBAAkB7B,UAAU;QAC9B;IACF,OAAO;QACL6C,IAAIlE,cAAcoE,KAAK,CAAC9D,QAAQoD,MAAM;YAAEW,OAAO;QAAU;IAC3D;IAEA,IAAIH,GAAG;QACLA,EAAEM,EAAE,CAAC,QAAQ,SAAUC,SAAS;YAC9B,IAAIA,WAAW;gBACbvB,kBAAkB7B,UAAU,WAAWoD,YAAY;YACrD;QACF;QACAP,EAAEM,EAAE,CAAC,SAAS,SAAUzB,KAAK;YAC3BG,kBAAkB7B,UAAU0B,MAAM2B,OAAO;QAC3C;IACF;AACF;AAEA,SAASpB,YAAY,GAAE","ignoreList":[0]}
1
+ {"version":3,"sources":["../../../../../src/client/components/react-dev-overlay/utils/launch-editor.ts"],"sourcesContent":["/**\n * MIT License\n *\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nimport { cyan, green, red } from '../../../../lib/picocolors'\nimport child_process from 'child_process'\nimport fs from 'fs'\nimport os from 'os'\nimport path from 'path'\nimport shellQuote from 'next/dist/compiled/shell-quote'\n\nfunction isTerminalEditor(editor: string) {\n switch (editor) {\n case 'vi':\n case 'vim':\n case 'nvim':\n case 'emacs':\n case 'nano': {\n return true\n }\n default: {\n }\n }\n return false\n}\n\n// Map from full process name to binary that starts the process\n// We can't just re-use full process name, because it will spawn a new instance\n// of the app every time\nconst COMMON_EDITORS_MACOS = {\n '/Applications/Atom.app/Contents/MacOS/Atom': 'atom',\n '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta':\n '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta',\n '/Applications/Brackets.app/Contents/MacOS/Brackets': 'brackets',\n '/Applications/Sublime Text.app/Contents/MacOS/Sublime Text':\n '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',\n '/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text':\n '/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl',\n '/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2':\n '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl',\n '/Applications/Visual Studio Code.app/Contents/MacOS/Electron':\n '/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code',\n '/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron':\n '/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code',\n '/Applications/VSCodium.app/Contents/MacOS/Electron':\n '/Applications/VSCodium.app/Contents/Resources/app/bin/code',\n '/Applications/AppCode.app/Contents/MacOS/appcode':\n '/Applications/AppCode.app/Contents/MacOS/appcode',\n '/Applications/CLion.app/Contents/MacOS/clion':\n '/Applications/CLion.app/Contents/MacOS/clion',\n '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea':\n '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea',\n '/Applications/PhpStorm.app/Contents/MacOS/phpstorm':\n '/Applications/PhpStorm.app/Contents/MacOS/phpstorm',\n '/Applications/PyCharm.app/Contents/MacOS/pycharm':\n '/Applications/PyCharm.app/Contents/MacOS/pycharm',\n '/Applications/PyCharm CE.app/Contents/MacOS/pycharm':\n '/Applications/PyCharm CE.app/Contents/MacOS/pycharm',\n '/Applications/RubyMine.app/Contents/MacOS/rubymine':\n '/Applications/RubyMine.app/Contents/MacOS/rubymine',\n '/Applications/WebStorm.app/Contents/MacOS/webstorm':\n '/Applications/WebStorm.app/Contents/MacOS/webstorm',\n '/Applications/MacVim.app/Contents/MacOS/MacVim': 'mvim',\n '/Applications/GoLand.app/Contents/MacOS/goland':\n '/Applications/GoLand.app/Contents/MacOS/goland',\n '/Applications/Rider.app/Contents/MacOS/rider':\n '/Applications/Rider.app/Contents/MacOS/rider',\n '/Applications/Cursor.app/Contents/MacOS/Cursor':\n '/Applications/Cursor.app/Contents/MacOS/Cursor',\n}\n\nconst COMMON_EDITORS_LINUX = {\n atom: 'atom',\n Brackets: 'brackets',\n code: 'code',\n 'code-insiders': 'code-insiders',\n vscodium: 'vscodium',\n emacs: 'emacs',\n gvim: 'gvim',\n 'idea.sh': 'idea',\n 'phpstorm.sh': 'phpstorm',\n 'pycharm.sh': 'pycharm',\n 'rubymine.sh': 'rubymine',\n sublime_text: 'sublime_text',\n vim: 'vim',\n nvim: 'nvim',\n 'webstorm.sh': 'webstorm',\n 'goland.sh': 'goland',\n 'rider.sh': 'rider',\n}\n\nconst COMMON_EDITORS_WIN = [\n 'Brackets.exe',\n 'Code.exe',\n 'Code - Insiders.exe',\n 'VSCodium.exe',\n 'atom.exe',\n 'sublime_text.exe',\n 'notepad++.exe',\n 'clion.exe',\n 'clion64.exe',\n 'idea.exe',\n 'idea64.exe',\n 'phpstorm.exe',\n 'phpstorm64.exe',\n 'pycharm.exe',\n 'pycharm64.exe',\n 'rubymine.exe',\n 'rubymine64.exe',\n 'webstorm.exe',\n 'webstorm64.exe',\n 'goland.exe',\n 'goland64.exe',\n 'rider.exe',\n 'rider64.exe',\n]\n\n// Transpiled version of: /^([A-Za-z]:[/\\\\])?[\\p{L}0-9/.\\-_\\\\]+$/u\n// Non-transpiled version requires support for Unicode property regex. Allows\n// alphanumeric characters, periods, dashes, slashes, and underscores.\nconst WINDOWS_FILE_NAME_ACCESS_LIST =\n /^([A-Za-z]:[/\\\\])?(?:[\\x2D-9A-Z\\\\_a-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C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0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEF\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7B9\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\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\\uDE80-\\uDEAA\\uDF00-\\uDF1A]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE83\\uDE86-\\uDE89\\uDE9D\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF44\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1]|\\uD821[\\uDC00-\\uDFF1]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00-\\uDD1E\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D])+$/\n\nfunction getArgumentsForLineNumber(\n editor: string,\n fileName: string,\n lineNumber: number,\n colNumber: number\n): string[] {\n const editorBasename = path.basename(editor).replace(/\\.(exe|cmd|bat)$/i, '')\n switch (editorBasename) {\n case 'atom':\n case 'Atom':\n case 'Atom Beta':\n case 'subl':\n case 'sublime':\n case 'sublime_text': {\n return [fileName + ':' + lineNumber + ':' + colNumber]\n }\n case 'wstorm':\n case 'charm': {\n return [fileName + ':' + lineNumber]\n }\n case 'notepad++': {\n return ['-n' + lineNumber, '-c' + colNumber, fileName]\n }\n case 'vim':\n case 'nvim':\n case 'mvim':\n case 'joe':\n case 'gvim': {\n return ['+' + lineNumber, fileName]\n }\n case 'emacs':\n case 'emacsclient': {\n return ['+' + lineNumber + ':' + colNumber, fileName]\n }\n case 'rmate':\n case 'mate':\n case 'mine': {\n return ['--line', lineNumber.toString(), fileName]\n }\n case 'code':\n case 'Code':\n case 'Cursor':\n case 'code-insiders':\n case 'Code - Insiders':\n case 'vscodium':\n case 'VSCodium': {\n return ['-g', fileName + ':' + lineNumber + ':' + colNumber]\n }\n case 'appcode':\n case 'clion':\n case 'clion64':\n case 'idea':\n case 'idea64':\n case 'phpstorm':\n case 'phpstorm64':\n case 'pycharm':\n case 'pycharm64':\n case 'rubymine':\n case 'rubymine64':\n case 'webstorm':\n case 'webstorm64':\n case 'goland':\n case 'goland64':\n case 'rider':\n case 'rider64': {\n return ['--line', lineNumber.toString(), fileName]\n }\n default: {\n // For all others, drop the lineNumber until we have\n // a mapping above, since providing the lineNumber incorrectly\n // can result in errors or confusing behavior.\n return [fileName]\n }\n }\n}\n\nfunction guessEditor(): string[] {\n // Explicit config always wins\n if (process.env.REACT_EDITOR) {\n return shellQuote.parse(process.env.REACT_EDITOR) as any\n }\n\n // We can find out which editor is currently running by:\n // `ps x` on macOS and Linux\n // `Get-Process` on Windows\n try {\n if (process.platform === 'darwin') {\n const output = child_process.execSync('ps x').toString()\n const processNames = Object.keys(COMMON_EDITORS_MACOS)\n for (let i = 0; i < processNames.length; i++) {\n const processName = processNames[i]\n if (output.indexOf(processName) !== -1) {\n return [(COMMON_EDITORS_MACOS as any)[processName]]\n }\n }\n } else if (process.platform === 'win32') {\n // Some processes need elevated rights to get its executable path.\n // Just filter them out upfront. This also saves 10-20ms on the command.\n const output = child_process\n .execSync(\n 'wmic process where \"executablepath is not null\" get executablepath'\n )\n .toString()\n const runningProcesses = output.split('\\r\\n')\n for (let i = 0; i < runningProcesses.length; i++) {\n const processPath = runningProcesses[i].trim()\n const processName = path.basename(processPath)\n if (COMMON_EDITORS_WIN.indexOf(processName) !== -1) {\n return [processPath]\n }\n }\n } else if (process.platform === 'linux') {\n // --no-heading No header line\n // x List all processes owned by you\n // -o comm Need only names column\n const output = child_process\n .execSync('ps x --no-heading -o comm --sort=comm')\n .toString()\n const processNames = Object.keys(COMMON_EDITORS_LINUX)\n for (let i = 0; i < processNames.length; i++) {\n const processName = processNames[i]\n if (output.indexOf(processName) !== -1) {\n return [(COMMON_EDITORS_LINUX as any)[processName] as string]\n }\n }\n }\n } catch (error) {\n // Ignore...\n }\n\n // Last resort, use old skool env vars\n if (process.env.VISUAL) {\n return [process.env.VISUAL]\n } else if (process.env.EDITOR) {\n return [process.env.EDITOR]\n }\n\n return []\n}\n\nfunction printInstructions(fileName: string, errorMessage: string | null) {\n console.log()\n console.log(\n red('Could not open ' + path.basename(fileName) + ' in the editor.')\n )\n if (errorMessage) {\n if (errorMessage[errorMessage.length - 1] !== '.') {\n errorMessage += '.'\n }\n console.log(red('The editor process exited with an error: ' + errorMessage))\n }\n console.log()\n console.log(\n 'To set up the editor integration, add something like ' +\n cyan('REACT_EDITOR=atom') +\n ' to the ' +\n green('.env.local') +\n ' file in your project folder ' +\n 'and restart the development server.'\n )\n console.log()\n}\n\nexport function escapeApplescriptStringFragment(input: string): string {\n // The only two special characters in a quoted applescript string are\n // backslash and double quote. Both are escaped with a preceeding backslash.\n //\n // Some whitespace characters (like newlines) can be escaped (as `\\n`), but\n // aren't required to be escaped (so we're not bothering to do that).\n //\n // https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_classes.html#//apple_ref/doc/uid/TP40000983-CH1g-BBCIAHJF:~:text=Special%20String%20Characters\n return input.replaceAll(/[\\\\\"]/g, (original) => `\\\\${original}`)\n}\n\nexport function launchEditor(\n fileName: string,\n lineNumber: number,\n colNumber: number\n) {\n if (!fs.existsSync(fileName)) {\n return\n }\n\n // Sanitize lineNumber to prevent malicious use on win32\n // via: https://github.com/nodejs/node/blob/c3bb4b1aa5e907d489619fb43d233c3336bfc03d/lib/child_process.js#L333\n // and it should be a positive integer\n if (!(Number.isInteger(lineNumber) && lineNumber > 0)) {\n return\n }\n\n // colNumber is optional, but should be a positive integer too\n // default is 1\n if (!(Number.isInteger(colNumber) && colNumber > 0)) {\n colNumber = 1\n }\n\n let [editor, ...args] = guessEditor()\n\n if (!editor) {\n printInstructions(fileName, null)\n return\n }\n\n if (editor.toLowerCase() === 'none') {\n return\n }\n\n if (\n process.platform === 'linux' &&\n fileName.startsWith('/mnt/') &&\n /Microsoft/i.test(os.release())\n ) {\n // Assume WSL / \"Bash on Ubuntu on Windows\" is being used, and\n // that the file exists on the Windows file system.\n // `os.release()` is \"4.4.0-43-Microsoft\" in the current release\n // build of WSL, see: https://github.com/Microsoft/BashOnWindows/issues/423#issuecomment-221627364\n // When a Windows editor is specified, interop functionality can\n // handle the path translation, but only if a relative path is used.\n fileName = path.relative('', fileName)\n }\n\n // cmd.exe on Windows is vulnerable to RCE attacks given a file name of the\n // form \"C:\\Users\\myusername\\Downloads\\& curl 172.21.93.52\". Use an access list\n // to validate user-provided file names. This doesn't cover the entire range\n // of valid file names but should cover almost all of them in practice.\n if (\n process.platform === 'win32' &&\n !WINDOWS_FILE_NAME_ACCESS_LIST.test(fileName.trim())\n ) {\n console.log()\n console.log(\n red('Could not open ' + path.basename(fileName) + ' in the editor.')\n )\n console.log()\n console.log(\n 'When running on Windows, file names are checked against an access list ' +\n 'to protect against remote code execution attacks. File names may ' +\n 'consist only of alphanumeric characters (all languages), periods, ' +\n 'dashes, slashes, and underscores.'\n )\n console.log()\n return\n }\n\n if (lineNumber) {\n args = args.concat(\n getArgumentsForLineNumber(editor, fileName, lineNumber, colNumber)\n )\n } else {\n args.push(fileName)\n }\n\n let p: child_process.ChildProcess | undefined = undefined\n if (process.platform === 'win32') {\n // On Windows, launch the editor in a shell because spawn can only\n // launch .exe files.\n p = child_process.spawn('cmd.exe', ['/C', editor].concat(args), {\n stdio: 'inherit',\n detached: true,\n })\n } else if (isTerminalEditor(editor)) {\n if (process.platform === 'darwin') {\n const escapedScript = escapeApplescriptStringFragment(\n shellQuote.quote([editor, ...args])\n )\n p = child_process.spawn(\n 'osascript',\n ['-e', `tell application \"Terminal\" to do script \"${escapedScript}\"`],\n { stdio: 'ignore' }\n )\n } else {\n printInstructions(fileName, 'Terminal editors can only be used on macOS.')\n }\n } else {\n p = child_process.spawn(editor, args, { stdio: 'inherit' })\n }\n\n if (p) {\n p.on('exit', function (errorCode) {\n if (errorCode) {\n printInstructions(fileName, '(code ' + errorCode + ')')\n }\n })\n p.on('error', function (error) {\n printInstructions(fileName, error.message)\n })\n }\n}\n"],"names":["cyan","green","red","child_process","fs","os","path","shellQuote","isTerminalEditor","editor","COMMON_EDITORS_MACOS","COMMON_EDITORS_LINUX","atom","Brackets","code","vscodium","emacs","gvim","sublime_text","vim","nvim","COMMON_EDITORS_WIN","WINDOWS_FILE_NAME_ACCESS_LIST","getArgumentsForLineNumber","fileName","lineNumber","colNumber","editorBasename","basename","replace","toString","guessEditor","process","env","REACT_EDITOR","parse","platform","output","execSync","processNames","Object","keys","i","length","processName","indexOf","runningProcesses","split","processPath","trim","error","VISUAL","EDITOR","printInstructions","errorMessage","console","log","escapeApplescriptStringFragment","input","replaceAll","original","launchEditor","existsSync","Number","isInteger","args","toLowerCase","startsWith","test","release","relative","concat","push","p","undefined","spawn","stdio","detached","escapedScript","quote","on","errorCode","message"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,SAASA,IAAI,EAAEC,KAAK,EAAEC,GAAG,QAAQ,6BAA4B;AAC7D,OAAOC,mBAAmB,gBAAe;AACzC,OAAOC,QAAQ,KAAI;AACnB,OAAOC,QAAQ,KAAI;AACnB,OAAOC,UAAU,OAAM;AACvB,OAAOC,gBAAgB,iCAAgC;AAEvD,SAASC,iBAAiBC,MAAc;IACtC,OAAQA;QACN,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;YAAQ;gBACX,OAAO;YACT;QACA;YAAS,CACT;IACF;IACA,OAAO;AACT;AAEA,+DAA+D;AAC/D,+EAA+E;AAC/E,wBAAwB;AACxB,MAAMC,uBAAuB;IAC3B,8CAA8C;IAC9C,wDACE;IACF,sDAAsD;IACtD,8DACE;IACF,kEACE;IACF,kEACE;IACF,gEACE;IACF,2EACE;IACF,sDACE;IACF,oDACE;IACF,gDACE;IACF,uDACE;IACF,sDACE;IACF,oDACE;IACF,uDACE;IACF,sDACE;IACF,sDACE;IACF,kDAAkD;IAClD,kDACE;IACF,gDACE;IACF,kDACE;AACJ;AAEA,MAAMC,uBAAuB;IAC3BC,MAAM;IACNC,UAAU;IACVC,MAAM;IACN,iBAAiB;IACjBC,UAAU;IACVC,OAAO;IACPC,MAAM;IACN,WAAW;IACX,eAAe;IACf,cAAc;IACd,eAAe;IACfC,cAAc;IACdC,KAAK;IACLC,MAAM;IACN,eAAe;IACf,aAAa;IACb,YAAY;AACd;AAEA,MAAMC,qBAAqB;IACzB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,kEAAkE;AAClE,6EAA6E;AAC7E,sEAAsE;AACtE,MAAMC,gCACJ;AAEF,SAASC,0BACPd,MAAc,EACde,QAAgB,EAChBC,UAAkB,EAClBC,SAAiB;IAEjB,MAAMC,iBAAiBrB,KAAKsB,QAAQ,CAACnB,QAAQoB,OAAO,CAAC,qBAAqB;IAC1E,OAAQF;QACN,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;YAAgB;gBACnB,OAAO;oBAACH,WAAW,MAAMC,aAAa,MAAMC;iBAAU;YACxD;QACA,KAAK;QACL,KAAK;YAAS;gBACZ,OAAO;oBAACF,WAAW,MAAMC;iBAAW;YACtC;QACA,KAAK;YAAa;gBAChB,OAAO;oBAA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;QAC9B;IACF,OAAO;QACLiD,IAAItE,cAAcwE,KAAK,CAAClE,QAAQwD,MAAM;YAAEW,OAAO;QAAU;IAC3D;IAEA,IAAIH,GAAG;QACLA,EAAEO,EAAE,CAAC,QAAQ,SAAUC,SAAS;YAC9B,IAAIA,WAAW;gBACb5B,kBAAkB7B,UAAU,WAAWyD,YAAY;YACrD;QACF;QACAR,EAAEO,EAAE,CAAC,SAAS,SAAU9B,KAAK;YAC3BG,kBAAkB7B,UAAU0B,MAAMgC,OAAO;QAC3C;IACF;AACF","ignoreList":[0]}
@@ -26,7 +26,7 @@ import { SearchParamsContext, PathParamsContext } from '../shared/lib/hooks-clie
26
26
  import { onRecoverableError } from './react-client-callbacks/on-recoverable-error';
27
27
  import tracer from './tracing/tracer';
28
28
  import { isNextRouterError } from './components/is-next-router-error';
29
- export const version = "15.4.0-canary.48";
29
+ export const version = "15.4.0-canary.49";
30
30
  export let router;
31
31
  export const emitter = mitt();
32
32
  const looseToArray = (input)=>[].slice.call(input);
@@ -199,6 +199,14 @@ async function exportPageImpl(input, fileWriter) {
199
199
  }
200
200
  export async function exportPages(input) {
201
201
  const { exportPathMap, paths, dir, distDir, outDir, cacheHandler, cacheMaxMemorySize, fetchCacheKeyPrefix, pagesDataDir, renderOpts, nextConfig, options } = input;
202
+ if (nextConfig.experimental.enablePrerenderSourceMaps) {
203
+ try {
204
+ // Same as `next dev`
205
+ // Limiting the stack trace to a useful amount of frames is handled by ignore-listing.
206
+ // TODO: How high can we go without severely impacting CPU/memory?
207
+ Error.stackTraceLimit = 50;
208
+ } catch {}
209
+ }
202
210
  // If the fetch cache was enabled, we need to create an incremental
203
211
  // cache instance for this page.
204
212
  const incrementalCache = await createIncrementalCache({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/export/worker.ts"],"sourcesContent":["import type {\n ExportPagesInput,\n ExportPageInput,\n ExportPageResult,\n ExportRouteResult,\n WorkerRenderOpts,\n ExportPagesResult,\n} from './types'\n\nimport '../server/node-environment'\n\nprocess.env.NEXT_IS_EXPORT_WORKER = 'true'\n\nimport { extname, join, dirname, sep } from 'path'\nimport fs from 'fs/promises'\nimport { loadComponents } from '../server/load-components'\nimport { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic'\nimport { normalizePagePath } from '../shared/lib/page-path/normalize-page-path'\nimport { normalizeLocalePath } from '../shared/lib/i18n/normalize-locale-path'\nimport { trace } from '../trace'\nimport { setHttpClientAndAgentOptions } from '../server/setup-http-agent-env'\nimport { addRequestMeta } from '../server/request-meta'\nimport { normalizeAppPath } from '../shared/lib/router/utils/app-paths'\n\nimport { createRequestResponseMocks } from '../server/lib/mock-request'\nimport { isAppRouteRoute } from '../lib/is-app-route-route'\nimport { hasNextSupport } from '../server/ci-info'\nimport { exportAppRoute } from './routes/app-route'\nimport { exportAppPage } from './routes/app-page'\nimport { exportPagesPage } from './routes/pages'\nimport { getParams } from './helpers/get-params'\nimport { createIncrementalCache } from './helpers/create-incremental-cache'\nimport { isPostpone } from '../server/lib/router-utils/is-postpone'\nimport { isDynamicUsageError } from './helpers/is-dynamic-usage-error'\nimport { isBailoutToCSRError } from '../shared/lib/lazy-dynamic/bailout-to-csr'\nimport {\n turborepoTraceAccess,\n TurborepoAccessTraceResult,\n} from '../build/turborepo-access-trace'\nimport type { Params } from '../server/request/params'\nimport {\n getFallbackRouteParams,\n type FallbackRouteParams,\n} from '../server/request/fallback-params'\nimport { needsExperimentalReact } from '../lib/needs-experimental-react'\nimport type { AppRouteRouteModule } from '../server/route-modules/app-route/module.compiled'\nimport { isStaticGenBailoutError } from '../client/components/static-generation-bailout'\nimport type { PagesRenderContext, PagesSharedContext } from '../server/render'\nimport type { AppSharedContext } from '../server/app-render/app-render'\nimport { MultiFileWriter } from '../lib/multi-file-writer'\n\nconst envConfig = require('../shared/lib/runtime-config.external')\n\n;(globalThis as any).__NEXT_DATA__ = {\n nextExport: true,\n}\n\nclass TimeoutError extends Error {\n code = 'NEXT_EXPORT_TIMEOUT_ERROR'\n}\n\nclass ExportPageError extends Error {\n code = 'NEXT_EXPORT_PAGE_ERROR'\n}\n\nasync function exportPageImpl(\n input: ExportPageInput,\n fileWriter: MultiFileWriter\n): Promise<ExportRouteResult | undefined> {\n const {\n path,\n pathMap,\n distDir,\n pagesDataDir,\n buildExport = false,\n serverRuntimeConfig,\n subFolders = false,\n optimizeCss,\n disableOptimizedLoading,\n debugOutput = false,\n enableExperimentalReact,\n ampValidatorPath,\n trailingSlash,\n sriEnabled,\n } = input\n\n if (enableExperimentalReact) {\n process.env.__NEXT_EXPERIMENTAL_REACT = 'true'\n }\n\n const {\n page,\n\n // The parameters that are currently unknown.\n _fallbackRouteParams = [],\n\n // Check if this is an `app/` page.\n _isAppDir: isAppDir = false,\n\n // Check if this should error when dynamic usage is detected.\n _isDynamicError: isDynamicError = false,\n\n // If this page supports partial prerendering, then we need to pass that to\n // the renderOpts.\n _isRoutePPREnabled: isRoutePPREnabled,\n\n // Configure the rendering of the page to allow that an empty static shell\n // is generated while rendering using PPR and Dynamic IO.\n _allowEmptyStaticShell: allowEmptyStaticShell = false,\n\n // Pull the original query out.\n query: originalQuery = {},\n } = pathMap\n\n const fallbackRouteParams: FallbackRouteParams | null =\n getFallbackRouteParams(_fallbackRouteParams)\n\n let query = { ...originalQuery }\n const pathname = normalizeAppPath(page)\n const isDynamic = isDynamicRoute(page)\n const outDir = isAppDir ? join(distDir, 'server/app') : input.outDir\n\n const filePath = normalizePagePath(path)\n const ampPath = `${filePath}.amp`\n let renderAmpPath = ampPath\n\n let updatedPath = pathMap._ssgPath || path\n let locale = pathMap._locale || input.renderOpts.locale\n\n if (input.renderOpts.locale) {\n const localePathResult = normalizeLocalePath(path, input.renderOpts.locales)\n\n if (localePathResult.detectedLocale) {\n updatedPath = localePathResult.pathname\n locale = localePathResult.detectedLocale\n\n if (locale === input.renderOpts.defaultLocale) {\n renderAmpPath = `${normalizePagePath(updatedPath)}.amp`\n }\n }\n }\n\n // We need to show a warning if they try to provide query values\n // for an auto-exported page since they won't be available\n const hasOrigQueryValues = Object.keys(originalQuery).length > 0\n\n // Check if the page is a specified dynamic route\n const { pathname: nonLocalizedPath } = normalizeLocalePath(\n path,\n input.renderOpts.locales\n )\n\n let params: Params | undefined\n\n if (isDynamic && page !== nonLocalizedPath) {\n const normalizedPage = isAppDir ? normalizeAppPath(page) : page\n\n params = getParams(normalizedPage, updatedPath)\n }\n\n const { req, res } = createRequestResponseMocks({ url: updatedPath })\n\n // If this is a status code page, then set the response code.\n for (const statusCode of [404, 500]) {\n if (\n [\n `/${statusCode}`,\n `/${statusCode}.html`,\n `/${statusCode}/index.html`,\n ].some((p) => p === updatedPath || `/${locale}${p}` === updatedPath)\n ) {\n res.statusCode = statusCode\n }\n }\n\n // Ensure that the URL has a trailing slash if it's configured.\n if (trailingSlash && !req.url?.endsWith('/')) {\n req.url += '/'\n }\n\n if (\n locale &&\n buildExport &&\n input.renderOpts.domainLocales &&\n input.renderOpts.domainLocales.some(\n (dl) => dl.defaultLocale === locale || dl.locales?.includes(locale || '')\n )\n ) {\n addRequestMeta(req, 'isLocaleDomain', true)\n }\n\n envConfig.setConfig({\n serverRuntimeConfig,\n publicRuntimeConfig: input.renderOpts.runtimeConfig,\n })\n\n const getHtmlFilename = (p: string) =>\n subFolders ? `${p}${sep}index.html` : `${p}.html`\n\n let htmlFilename = getHtmlFilename(filePath)\n\n // dynamic routes can provide invalid extensions e.g. /blog/[...slug] returns an\n // extension of `.slug]`\n const pageExt = isDynamic || isAppDir ? '' : extname(page)\n const pathExt = isDynamic || isAppDir ? '' : extname(path)\n\n // force output 404.html for backwards compat\n if (path === '/404.html') {\n htmlFilename = path\n }\n // Make sure page isn't a folder with a dot in the name e.g. `v1.2`\n else if (pageExt !== pathExt && pathExt !== '') {\n const isBuiltinPaths = ['/500', '/404'].some(\n (p) => p === path || p === path + '.html'\n )\n // If the ssg path has .html extension, and it's not builtin paths, use it directly\n // Otherwise, use that as the filename instead\n const isHtmlExtPath = !isBuiltinPaths && path.endsWith('.html')\n htmlFilename = isHtmlExtPath ? getHtmlFilename(path) : path\n } else if (path === '/') {\n // If the path is the root, just use index.html\n htmlFilename = 'index.html'\n }\n\n const baseDir = join(outDir, dirname(htmlFilename))\n let htmlFilepath = join(outDir, htmlFilename)\n\n await fs.mkdir(baseDir, { recursive: true })\n\n const components = await loadComponents({\n distDir,\n page,\n isAppPath: isAppDir,\n isDev: false,\n sriEnabled,\n })\n\n // Handle App Routes.\n if (isAppDir && isAppRouteRoute(page)) {\n return exportAppRoute(\n req,\n res,\n params,\n page,\n components.routeModule as AppRouteRouteModule,\n input.renderOpts.incrementalCache,\n input.renderOpts.cacheLifeProfiles,\n htmlFilepath,\n fileWriter,\n input.renderOpts.experimental,\n input.buildId\n )\n }\n\n const renderOpts: WorkerRenderOpts = {\n ...components,\n ...input.renderOpts,\n ampPath: renderAmpPath,\n params,\n optimizeCss,\n disableOptimizedLoading,\n locale,\n supportsDynamicResponse: false,\n // During the export phase in next build, we always enable the streaming metadata since if there's\n // any dynamic access in metadata we can determine it in the build phase.\n // If it's static, then it won't affect anything.\n // If it's dynamic, then it can be handled when request hits the route.\n serveStreamingMetadata: true,\n allowEmptyStaticShell,\n experimental: {\n ...input.renderOpts.experimental,\n isRoutePPREnabled,\n },\n }\n\n if (hasNextSupport) {\n renderOpts.isRevalidate = true\n }\n\n // Handle App Pages\n if (isAppDir) {\n const sharedContext: AppSharedContext = {\n buildId: input.buildId,\n }\n\n return exportAppPage(\n req,\n res,\n page,\n path,\n pathname,\n query,\n fallbackRouteParams,\n renderOpts,\n htmlFilepath,\n debugOutput,\n isDynamicError,\n fileWriter,\n sharedContext\n )\n }\n\n const sharedContext: PagesSharedContext = {\n buildId: input.buildId,\n deploymentId: input.renderOpts.deploymentId,\n customServer: undefined,\n }\n\n const renderContext: PagesRenderContext = {\n isFallback: pathMap._pagesFallback ?? false,\n isDraftMode: false,\n developmentNotFoundSourcePage: undefined,\n }\n\n return exportPagesPage(\n req,\n res,\n path,\n page,\n query,\n params,\n htmlFilepath,\n htmlFilename,\n ampPath,\n subFolders,\n outDir,\n ampValidatorPath,\n pagesDataDir,\n buildExport,\n isDynamic,\n sharedContext,\n renderContext,\n hasOrigQueryValues,\n renderOpts,\n components,\n fileWriter\n )\n}\n\nexport async function exportPages(\n input: ExportPagesInput\n): Promise<ExportPagesResult> {\n const {\n exportPathMap,\n paths,\n dir,\n distDir,\n outDir,\n cacheHandler,\n cacheMaxMemorySize,\n fetchCacheKeyPrefix,\n pagesDataDir,\n renderOpts,\n nextConfig,\n options,\n } = input\n\n // If the fetch cache was enabled, we need to create an incremental\n // cache instance for this page.\n const incrementalCache = await createIncrementalCache({\n cacheHandler,\n cacheMaxMemorySize,\n fetchCacheKeyPrefix,\n distDir,\n dir,\n // skip writing to disk in minimal mode for now, pending some\n // changes to better support it\n flushToDisk: !hasNextSupport,\n cacheHandlers: nextConfig.experimental.cacheHandlers,\n })\n\n renderOpts.incrementalCache = incrementalCache\n\n const maxConcurrency =\n nextConfig.experimental.staticGenerationMaxConcurrency ?? 8\n const results: ExportPagesResult = []\n\n const exportPageWithRetry = async (path: string, maxAttempts: number) => {\n const pathMap = exportPathMap[path]\n const { page } = exportPathMap[path]\n const pageKey = page !== path ? `${page}: ${path}` : path\n let attempt = 0\n let result\n\n const hasDebuggerAttached =\n // Also tests for `inspect-brk`\n process.env.NODE_OPTIONS?.includes('--inspect')\n\n while (attempt < maxAttempts) {\n try {\n result = await Promise.race<ExportPageResult | undefined>([\n exportPage({\n path,\n pathMap,\n distDir,\n outDir,\n pagesDataDir,\n renderOpts,\n ampValidatorPath:\n nextConfig.experimental.amp?.validator || undefined,\n trailingSlash: nextConfig.trailingSlash,\n serverRuntimeConfig: nextConfig.serverRuntimeConfig,\n subFolders: nextConfig.trailingSlash && !options.buildExport,\n buildExport: options.buildExport,\n optimizeCss: nextConfig.experimental.optimizeCss,\n disableOptimizedLoading:\n nextConfig.experimental.disableOptimizedLoading,\n parentSpanId: input.parentSpanId,\n httpAgentOptions: nextConfig.httpAgentOptions,\n debugOutput: options.debugOutput,\n enableExperimentalReact: needsExperimentalReact(nextConfig),\n sriEnabled: Boolean(nextConfig.experimental.sri?.algorithm),\n buildId: input.buildId,\n }),\n hasDebuggerAttached\n ? // With a debugger attached, exporting can take infinitely if we paused script execution.\n new Promise(() => {})\n : // If exporting the page takes longer than the timeout, reject the promise.\n new Promise((_, reject) => {\n setTimeout(() => {\n reject(new TimeoutError())\n }, nextConfig.staticPageGenerationTimeout * 1000)\n }),\n ])\n\n // If there was an error in the export, throw it immediately. In the catch block, we might retry the export,\n // or immediately fail the build, depending on user configuration. We might also continue on and attempt other pages.\n if (result && 'error' in result) {\n throw new ExportPageError()\n }\n\n // If the export succeeds, break out of the retry loop\n break\n } catch (err) {\n // The only error that should be caught here is an ExportError, as `exportPage` doesn't throw and instead returns an object with an `error` property.\n // This is an overly cautious check to ensure that we don't accidentally catch an unexpected error.\n if (!(err instanceof ExportPageError || err instanceof TimeoutError)) {\n throw err\n }\n\n if (err instanceof TimeoutError) {\n // If the export times out, we will restart the worker up to 3 times.\n maxAttempts = 3\n }\n\n // We've reached the maximum number of attempts\n if (attempt >= maxAttempts - 1) {\n // Log a message if we've reached the maximum number of attempts.\n // We only care to do this if maxAttempts was configured.\n if (maxAttempts > 1) {\n console.info(\n `Failed to build ${pageKey} after ${maxAttempts} attempts.`\n )\n }\n // If prerenderEarlyExit is enabled, we'll exit the build immediately.\n if (nextConfig.experimental.prerenderEarlyExit) {\n console.error(\n `Export encountered an error on ${pageKey}, exiting the build.`\n )\n process.exit(1)\n } else {\n // Otherwise, this is a no-op. The build will continue, and a summary of failed pages will be displayed at the end.\n }\n } else {\n // Otherwise, we have more attempts to make. Wait before retrying\n if (err instanceof TimeoutError) {\n console.info(\n `Failed to build ${pageKey} (attempt ${attempt + 1} of ${maxAttempts}) because it took more than ${nextConfig.staticPageGenerationTimeout} seconds. Retrying again shortly.`\n )\n } else {\n console.info(\n `Failed to build ${pageKey} (attempt ${attempt + 1} of ${maxAttempts}). Retrying again shortly.`\n )\n }\n\n // Exponential backoff with random jitter to avoid thundering herd on retries\n const baseDelay = 500 // 500ms\n const maxDelay = 2000 // 2 seconds\n const delay = Math.min(baseDelay * Math.pow(2, attempt), maxDelay)\n const jitter = Math.random() * 0.3 * delay // Add up to 30% random jitter\n await new Promise((r) => setTimeout(r, delay + jitter))\n }\n }\n\n attempt++\n }\n\n return { result, path, pageKey }\n }\n\n for (let i = 0; i < paths.length; i += maxConcurrency) {\n const subset = paths.slice(i, i + maxConcurrency)\n\n const subsetResults = await Promise.all(\n subset.map((path) =>\n exportPageWithRetry(\n path,\n nextConfig.experimental.staticGenerationRetryCount ?? 1\n )\n )\n )\n\n results.push(...subsetResults)\n }\n\n return results\n}\n\nasync function exportPage(\n input: ExportPageInput\n): Promise<ExportPageResult | undefined> {\n trace('export-page', input.parentSpanId).setAttribute('path', input.path)\n\n // Configure the http agent.\n setHttpClientAndAgentOptions({\n httpAgentOptions: input.httpAgentOptions,\n })\n\n const fileWriter = new MultiFileWriter({\n writeFile: (filePath, data) => fs.writeFile(filePath, data),\n mkdir: (dir) => fs.mkdir(dir, { recursive: true }),\n })\n\n const exportPageSpan = trace('export-page-worker', input.parentSpanId)\n\n const start = Date.now()\n\n const turborepoAccessTraceResult = new TurborepoAccessTraceResult()\n\n // Export the page.\n let result: ExportRouteResult | undefined\n try {\n result = await exportPageSpan.traceAsyncFn(() =>\n turborepoTraceAccess(\n () => exportPageImpl(input, fileWriter),\n turborepoAccessTraceResult\n )\n )\n\n // Wait for all the files to flush to disk.\n await fileWriter.wait()\n\n // If there was no result, then we can exit early.\n if (!result) return\n\n // If there was an error, then we can exit early.\n if ('error' in result) {\n return { error: result.error, duration: Date.now() - start }\n }\n } catch (err) {\n console.error(\n `Error occurred prerendering page \"${input.path}\". Read more: https://nextjs.org/docs/messages/prerender-error`\n )\n\n // bailoutToCSRError errors should not leak to the user as they are not actionable; they're\n // a framework signal\n if (!isBailoutToCSRError(err)) {\n // A static generation bailout error is a framework signal to fail static generation but\n // and will encode a reason in the error message. If there is a message, we'll print it.\n // Otherwise there's nothing to show as we don't want to leak an error internal error stack to the user.\n // TODO: Always log the full error. ignore-listing will take care of hiding internal stacks.\n if (isStaticGenBailoutError(err)) {\n if (err.message) {\n console.error(`Error: ${err.message}`)\n }\n } else {\n console.error(err)\n }\n }\n\n return { error: true, duration: Date.now() - start }\n }\n\n // Notify the parent process that we processed a page (used by the progress activity indicator)\n process.send?.([3, { type: 'activity' }])\n\n // Otherwise we can return the result.\n return {\n duration: Date.now() - start,\n ampValidations: result.ampValidations,\n cacheControl: result.cacheControl,\n metadata: result.metadata,\n ssgNotFound: result.ssgNotFound,\n hasEmptyStaticShell: result.hasEmptyStaticShell,\n hasPostponed: result.hasPostponed,\n turborepoAccessTraceResult: turborepoAccessTraceResult.serialize(),\n fetchMetrics: result.fetchMetrics,\n }\n}\n\nprocess.on('unhandledRejection', (err: unknown) => {\n // if it's a postpone error, it'll be handled later\n // when the postponed promise is actually awaited.\n if (isPostpone(err)) {\n return\n }\n\n // we don't want to log these errors\n if (isDynamicUsageError(err)) {\n return\n }\n\n console.error(err)\n})\n\nprocess.on('rejectionHandled', () => {\n // It is ok to await a Promise late in Next.js as it allows for better\n // prefetching patterns to avoid waterfalls. We ignore logging these.\n // We should've already errored in anyway unhandledRejection.\n})\n\nconst FATAL_UNHANDLED_NEXT_API_EXIT_CODE = 78\n\nprocess.on('uncaughtException', (err) => {\n if (isDynamicUsageError(err)) {\n console.error(\n 'A Next.js API that uses exceptions to signal framework behavior was uncaught. This suggests improper usage of a Next.js API. The original error is printed below and the build will now exit.'\n )\n console.error(err)\n process.exit(FATAL_UNHANDLED_NEXT_API_EXIT_CODE)\n } else {\n console.error(err)\n }\n})\n"],"names":["process","env","NEXT_IS_EXPORT_WORKER","extname","join","dirname","sep","fs","loadComponents","isDynamicRoute","normalizePagePath","normalizeLocalePath","trace","setHttpClientAndAgentOptions","addRequestMeta","normalizeAppPath","createRequestResponseMocks","isAppRouteRoute","hasNextSupport","exportAppRoute","exportAppPage","exportPagesPage","getParams","createIncrementalCache","isPostpone","isDynamicUsageError","isBailoutToCSRError","turborepoTraceAccess","TurborepoAccessTraceResult","getFallbackRouteParams","needsExperimentalReact","isStaticGenBailoutError","MultiFileWriter","envConfig","require","globalThis","__NEXT_DATA__","nextExport","TimeoutError","Error","code","ExportPageError","exportPageImpl","input","fileWriter","req","path","pathMap","distDir","pagesDataDir","buildExport","serverRuntimeConfig","subFolders","optimizeCss","disableOptimizedLoading","debugOutput","enableExperimentalReact","ampValidatorPath","trailingSlash","sriEnabled","__NEXT_EXPERIMENTAL_REACT","page","_fallbackRouteParams","_isAppDir","isAppDir","_isDynamicError","isDynamicError","_isRoutePPREnabled","isRoutePPREnabled","_allowEmptyStaticShell","allowEmptyStaticShell","query","originalQuery","fallbackRouteParams","pathname","isDynamic","outDir","filePath","ampPath","renderAmpPath","updatedPath","_ssgPath","locale","_locale","renderOpts","localePathResult","locales","detectedLocale","defaultLocale","hasOrigQueryValues","Object","keys","length","nonLocalizedPath","params","normalizedPage","res","url","statusCode","some","p","endsWith","domainLocales","dl","includes","setConfig","publicRuntimeConfig","runtimeConfig","getHtmlFilename","htmlFilename","pageExt","pathExt","isBuiltinPaths","isHtmlExtPath","baseDir","htmlFilepath","mkdir","recursive","components","isAppPath","isDev","routeModule","incrementalCache","cacheLifeProfiles","experimental","buildId","supportsDynamicResponse","serveStreamingMetadata","isRevalidate","sharedContext","deploymentId","customServer","undefined","renderContext","isFallback","_pagesFallback","isDraftMode","developmentNotFoundSourcePage","exportPages","exportPathMap","paths","dir","cacheHandler","cacheMaxMemorySize","fetchCacheKeyPrefix","nextConfig","options","flushToDisk","cacheHandlers","maxConcurrency","staticGenerationMaxConcurrency","results","exportPageWithRetry","maxAttempts","pageKey","attempt","result","hasDebuggerAttached","NODE_OPTIONS","Promise","race","exportPage","amp","validator","parentSpanId","httpAgentOptions","Boolean","sri","algorithm","_","reject","setTimeout","staticPageGenerationTimeout","err","console","info","prerenderEarlyExit","error","exit","baseDelay","maxDelay","delay","Math","min","pow","jitter","random","r","i","subset","slice","subsetResults","all","map","staticGenerationRetryCount","push","setAttribute","writeFile","data","exportPageSpan","start","Date","now","turborepoAccessTraceResult","traceAsyncFn","wait","duration","message","send","type","ampValidations","cacheControl","metadata","ssgNotFound","hasEmptyStaticShell","hasPostponed","serialize","fetchMetrics","on","FATAL_UNHANDLED_NEXT_API_EXIT_CODE"],"mappings":"AASA,OAAO,6BAA4B;AAEnCA,QAAQC,GAAG,CAACC,qBAAqB,GAAG;AAEpC,SAASC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,GAAG,QAAQ,OAAM;AAClD,OAAOC,QAAQ,cAAa;AAC5B,SAASC,cAAc,QAAQ,4BAA2B;AAC1D,SAASC,cAAc,QAAQ,wCAAuC;AACtE,SAASC,iBAAiB,QAAQ,8CAA6C;AAC/E,SAASC,mBAAmB,QAAQ,2CAA0C;AAC9E,SAASC,KAAK,QAAQ,WAAU;AAChC,SAASC,4BAA4B,QAAQ,iCAAgC;AAC7E,SAASC,cAAc,QAAQ,yBAAwB;AACvD,SAASC,gBAAgB,QAAQ,uCAAsC;AAEvE,SAASC,0BAA0B,QAAQ,6BAA4B;AACvE,SAASC,eAAe,QAAQ,4BAA2B;AAC3D,SAASC,cAAc,QAAQ,oBAAmB;AAClD,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,aAAa,QAAQ,oBAAmB;AACjD,SAASC,eAAe,QAAQ,iBAAgB;AAChD,SAASC,SAAS,QAAQ,uBAAsB;AAChD,SAASC,sBAAsB,QAAQ,qCAAoC;AAC3E,SAASC,UAAU,QAAQ,yCAAwC;AACnE,SAASC,mBAAmB,QAAQ,mCAAkC;AACtE,SAASC,mBAAmB,QAAQ,4CAA2C;AAC/E,SACEC,oBAAoB,EACpBC,0BAA0B,QACrB,kCAAiC;AAExC,SACEC,sBAAsB,QAEjB,oCAAmC;AAC1C,SAASC,sBAAsB,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 {"version":3,"sources":["../../src/export/worker.ts"],"sourcesContent":["import type {\n ExportPagesInput,\n ExportPageInput,\n ExportPageResult,\n ExportRouteResult,\n WorkerRenderOpts,\n ExportPagesResult,\n} from './types'\n\nimport '../server/node-environment'\n\nprocess.env.NEXT_IS_EXPORT_WORKER = 'true'\n\nimport { extname, join, dirname, sep } from 'path'\nimport fs from 'fs/promises'\nimport { loadComponents } from '../server/load-components'\nimport { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic'\nimport { normalizePagePath } from '../shared/lib/page-path/normalize-page-path'\nimport { normalizeLocalePath } from '../shared/lib/i18n/normalize-locale-path'\nimport { trace } from '../trace'\nimport { setHttpClientAndAgentOptions } from '../server/setup-http-agent-env'\nimport { addRequestMeta } from '../server/request-meta'\nimport { normalizeAppPath } from '../shared/lib/router/utils/app-paths'\n\nimport { createRequestResponseMocks } from '../server/lib/mock-request'\nimport { isAppRouteRoute } from '../lib/is-app-route-route'\nimport { hasNextSupport } from '../server/ci-info'\nimport { exportAppRoute } from './routes/app-route'\nimport { exportAppPage } from './routes/app-page'\nimport { exportPagesPage } from './routes/pages'\nimport { getParams } from './helpers/get-params'\nimport { createIncrementalCache } from './helpers/create-incremental-cache'\nimport { isPostpone } from '../server/lib/router-utils/is-postpone'\nimport { isDynamicUsageError } from './helpers/is-dynamic-usage-error'\nimport { isBailoutToCSRError } from '../shared/lib/lazy-dynamic/bailout-to-csr'\nimport {\n turborepoTraceAccess,\n TurborepoAccessTraceResult,\n} from '../build/turborepo-access-trace'\nimport type { Params } from '../server/request/params'\nimport {\n getFallbackRouteParams,\n type FallbackRouteParams,\n} from '../server/request/fallback-params'\nimport { needsExperimentalReact } from '../lib/needs-experimental-react'\nimport type { AppRouteRouteModule } from '../server/route-modules/app-route/module.compiled'\nimport { isStaticGenBailoutError } from '../client/components/static-generation-bailout'\nimport type { PagesRenderContext, PagesSharedContext } from '../server/render'\nimport type { AppSharedContext } from '../server/app-render/app-render'\nimport { MultiFileWriter } from '../lib/multi-file-writer'\n\nconst envConfig = require('../shared/lib/runtime-config.external')\n\n;(globalThis as any).__NEXT_DATA__ = {\n nextExport: true,\n}\n\nclass TimeoutError extends Error {\n code = 'NEXT_EXPORT_TIMEOUT_ERROR'\n}\n\nclass ExportPageError extends Error {\n code = 'NEXT_EXPORT_PAGE_ERROR'\n}\n\nasync function exportPageImpl(\n input: ExportPageInput,\n fileWriter: MultiFileWriter\n): Promise<ExportRouteResult | undefined> {\n const {\n path,\n pathMap,\n distDir,\n pagesDataDir,\n buildExport = false,\n serverRuntimeConfig,\n subFolders = false,\n optimizeCss,\n disableOptimizedLoading,\n debugOutput = false,\n enableExperimentalReact,\n ampValidatorPath,\n trailingSlash,\n sriEnabled,\n } = input\n\n if (enableExperimentalReact) {\n process.env.__NEXT_EXPERIMENTAL_REACT = 'true'\n }\n\n const {\n page,\n\n // The parameters that are currently unknown.\n _fallbackRouteParams = [],\n\n // Check if this is an `app/` page.\n _isAppDir: isAppDir = false,\n\n // Check if this should error when dynamic usage is detected.\n _isDynamicError: isDynamicError = false,\n\n // If this page supports partial prerendering, then we need to pass that to\n // the renderOpts.\n _isRoutePPREnabled: isRoutePPREnabled,\n\n // Configure the rendering of the page to allow that an empty static shell\n // is generated while rendering using PPR and Dynamic IO.\n _allowEmptyStaticShell: allowEmptyStaticShell = false,\n\n // Pull the original query out.\n query: originalQuery = {},\n } = pathMap\n\n const fallbackRouteParams: FallbackRouteParams | null =\n getFallbackRouteParams(_fallbackRouteParams)\n\n let query = { ...originalQuery }\n const pathname = normalizeAppPath(page)\n const isDynamic = isDynamicRoute(page)\n const outDir = isAppDir ? join(distDir, 'server/app') : input.outDir\n\n const filePath = normalizePagePath(path)\n const ampPath = `${filePath}.amp`\n let renderAmpPath = ampPath\n\n let updatedPath = pathMap._ssgPath || path\n let locale = pathMap._locale || input.renderOpts.locale\n\n if (input.renderOpts.locale) {\n const localePathResult = normalizeLocalePath(path, input.renderOpts.locales)\n\n if (localePathResult.detectedLocale) {\n updatedPath = localePathResult.pathname\n locale = localePathResult.detectedLocale\n\n if (locale === input.renderOpts.defaultLocale) {\n renderAmpPath = `${normalizePagePath(updatedPath)}.amp`\n }\n }\n }\n\n // We need to show a warning if they try to provide query values\n // for an auto-exported page since they won't be available\n const hasOrigQueryValues = Object.keys(originalQuery).length > 0\n\n // Check if the page is a specified dynamic route\n const { pathname: nonLocalizedPath } = normalizeLocalePath(\n path,\n input.renderOpts.locales\n )\n\n let params: Params | undefined\n\n if (isDynamic && page !== nonLocalizedPath) {\n const normalizedPage = isAppDir ? normalizeAppPath(page) : page\n\n params = getParams(normalizedPage, updatedPath)\n }\n\n const { req, res } = createRequestResponseMocks({ url: updatedPath })\n\n // If this is a status code page, then set the response code.\n for (const statusCode of [404, 500]) {\n if (\n [\n `/${statusCode}`,\n `/${statusCode}.html`,\n `/${statusCode}/index.html`,\n ].some((p) => p === updatedPath || `/${locale}${p}` === updatedPath)\n ) {\n res.statusCode = statusCode\n }\n }\n\n // Ensure that the URL has a trailing slash if it's configured.\n if (trailingSlash && !req.url?.endsWith('/')) {\n req.url += '/'\n }\n\n if (\n locale &&\n buildExport &&\n input.renderOpts.domainLocales &&\n input.renderOpts.domainLocales.some(\n (dl) => dl.defaultLocale === locale || dl.locales?.includes(locale || '')\n )\n ) {\n addRequestMeta(req, 'isLocaleDomain', true)\n }\n\n envConfig.setConfig({\n serverRuntimeConfig,\n publicRuntimeConfig: input.renderOpts.runtimeConfig,\n })\n\n const getHtmlFilename = (p: string) =>\n subFolders ? `${p}${sep}index.html` : `${p}.html`\n\n let htmlFilename = getHtmlFilename(filePath)\n\n // dynamic routes can provide invalid extensions e.g. /blog/[...slug] returns an\n // extension of `.slug]`\n const pageExt = isDynamic || isAppDir ? '' : extname(page)\n const pathExt = isDynamic || isAppDir ? '' : extname(path)\n\n // force output 404.html for backwards compat\n if (path === '/404.html') {\n htmlFilename = path\n }\n // Make sure page isn't a folder with a dot in the name e.g. `v1.2`\n else if (pageExt !== pathExt && pathExt !== '') {\n const isBuiltinPaths = ['/500', '/404'].some(\n (p) => p === path || p === path + '.html'\n )\n // If the ssg path has .html extension, and it's not builtin paths, use it directly\n // Otherwise, use that as the filename instead\n const isHtmlExtPath = !isBuiltinPaths && path.endsWith('.html')\n htmlFilename = isHtmlExtPath ? getHtmlFilename(path) : path\n } else if (path === '/') {\n // If the path is the root, just use index.html\n htmlFilename = 'index.html'\n }\n\n const baseDir = join(outDir, dirname(htmlFilename))\n let htmlFilepath = join(outDir, htmlFilename)\n\n await fs.mkdir(baseDir, { recursive: true })\n\n const components = await loadComponents({\n distDir,\n page,\n isAppPath: isAppDir,\n isDev: false,\n sriEnabled,\n })\n\n // Handle App Routes.\n if (isAppDir && isAppRouteRoute(page)) {\n return exportAppRoute(\n req,\n res,\n params,\n page,\n components.routeModule as AppRouteRouteModule,\n input.renderOpts.incrementalCache,\n input.renderOpts.cacheLifeProfiles,\n htmlFilepath,\n fileWriter,\n input.renderOpts.experimental,\n input.buildId\n )\n }\n\n const renderOpts: WorkerRenderOpts = {\n ...components,\n ...input.renderOpts,\n ampPath: renderAmpPath,\n params,\n optimizeCss,\n disableOptimizedLoading,\n locale,\n supportsDynamicResponse: false,\n // During the export phase in next build, we always enable the streaming metadata since if there's\n // any dynamic access in metadata we can determine it in the build phase.\n // If it's static, then it won't affect anything.\n // If it's dynamic, then it can be handled when request hits the route.\n serveStreamingMetadata: true,\n allowEmptyStaticShell,\n experimental: {\n ...input.renderOpts.experimental,\n isRoutePPREnabled,\n },\n }\n\n if (hasNextSupport) {\n renderOpts.isRevalidate = true\n }\n\n // Handle App Pages\n if (isAppDir) {\n const sharedContext: AppSharedContext = {\n buildId: input.buildId,\n }\n\n return exportAppPage(\n req,\n res,\n page,\n path,\n pathname,\n query,\n fallbackRouteParams,\n renderOpts,\n htmlFilepath,\n debugOutput,\n isDynamicError,\n fileWriter,\n sharedContext\n )\n }\n\n const sharedContext: PagesSharedContext = {\n buildId: input.buildId,\n deploymentId: input.renderOpts.deploymentId,\n customServer: undefined,\n }\n\n const renderContext: PagesRenderContext = {\n isFallback: pathMap._pagesFallback ?? false,\n isDraftMode: false,\n developmentNotFoundSourcePage: undefined,\n }\n\n return exportPagesPage(\n req,\n res,\n path,\n page,\n query,\n params,\n htmlFilepath,\n htmlFilename,\n ampPath,\n subFolders,\n outDir,\n ampValidatorPath,\n pagesDataDir,\n buildExport,\n isDynamic,\n sharedContext,\n renderContext,\n hasOrigQueryValues,\n renderOpts,\n components,\n fileWriter\n )\n}\n\nexport async function exportPages(\n input: ExportPagesInput\n): Promise<ExportPagesResult> {\n const {\n exportPathMap,\n paths,\n dir,\n distDir,\n outDir,\n cacheHandler,\n cacheMaxMemorySize,\n fetchCacheKeyPrefix,\n pagesDataDir,\n renderOpts,\n nextConfig,\n options,\n } = input\n\n if (nextConfig.experimental.enablePrerenderSourceMaps) {\n try {\n // Same as `next dev`\n // Limiting the stack trace to a useful amount of frames is handled by ignore-listing.\n // TODO: How high can we go without severely impacting CPU/memory?\n Error.stackTraceLimit = 50\n } catch {}\n }\n\n // If the fetch cache was enabled, we need to create an incremental\n // cache instance for this page.\n const incrementalCache = await createIncrementalCache({\n cacheHandler,\n cacheMaxMemorySize,\n fetchCacheKeyPrefix,\n distDir,\n dir,\n // skip writing to disk in minimal mode for now, pending some\n // changes to better support it\n flushToDisk: !hasNextSupport,\n cacheHandlers: nextConfig.experimental.cacheHandlers,\n })\n\n renderOpts.incrementalCache = incrementalCache\n\n const maxConcurrency =\n nextConfig.experimental.staticGenerationMaxConcurrency ?? 8\n const results: ExportPagesResult = []\n\n const exportPageWithRetry = async (path: string, maxAttempts: number) => {\n const pathMap = exportPathMap[path]\n const { page } = exportPathMap[path]\n const pageKey = page !== path ? `${page}: ${path}` : path\n let attempt = 0\n let result\n\n const hasDebuggerAttached =\n // Also tests for `inspect-brk`\n process.env.NODE_OPTIONS?.includes('--inspect')\n\n while (attempt < maxAttempts) {\n try {\n result = await Promise.race<ExportPageResult | undefined>([\n exportPage({\n path,\n pathMap,\n distDir,\n outDir,\n pagesDataDir,\n renderOpts,\n ampValidatorPath:\n nextConfig.experimental.amp?.validator || undefined,\n trailingSlash: nextConfig.trailingSlash,\n serverRuntimeConfig: nextConfig.serverRuntimeConfig,\n subFolders: nextConfig.trailingSlash && !options.buildExport,\n buildExport: options.buildExport,\n optimizeCss: nextConfig.experimental.optimizeCss,\n disableOptimizedLoading:\n nextConfig.experimental.disableOptimizedLoading,\n parentSpanId: input.parentSpanId,\n httpAgentOptions: nextConfig.httpAgentOptions,\n debugOutput: options.debugOutput,\n enableExperimentalReact: needsExperimentalReact(nextConfig),\n sriEnabled: Boolean(nextConfig.experimental.sri?.algorithm),\n buildId: input.buildId,\n }),\n hasDebuggerAttached\n ? // With a debugger attached, exporting can take infinitely if we paused script execution.\n new Promise(() => {})\n : // If exporting the page takes longer than the timeout, reject the promise.\n new Promise((_, reject) => {\n setTimeout(() => {\n reject(new TimeoutError())\n }, nextConfig.staticPageGenerationTimeout * 1000)\n }),\n ])\n\n // If there was an error in the export, throw it immediately. In the catch block, we might retry the export,\n // or immediately fail the build, depending on user configuration. We might also continue on and attempt other pages.\n if (result && 'error' in result) {\n throw new ExportPageError()\n }\n\n // If the export succeeds, break out of the retry loop\n break\n } catch (err) {\n // The only error that should be caught here is an ExportError, as `exportPage` doesn't throw and instead returns an object with an `error` property.\n // This is an overly cautious check to ensure that we don't accidentally catch an unexpected error.\n if (!(err instanceof ExportPageError || err instanceof TimeoutError)) {\n throw err\n }\n\n if (err instanceof TimeoutError) {\n // If the export times out, we will restart the worker up to 3 times.\n maxAttempts = 3\n }\n\n // We've reached the maximum number of attempts\n if (attempt >= maxAttempts - 1) {\n // Log a message if we've reached the maximum number of attempts.\n // We only care to do this if maxAttempts was configured.\n if (maxAttempts > 1) {\n console.info(\n `Failed to build ${pageKey} after ${maxAttempts} attempts.`\n )\n }\n // If prerenderEarlyExit is enabled, we'll exit the build immediately.\n if (nextConfig.experimental.prerenderEarlyExit) {\n console.error(\n `Export encountered an error on ${pageKey}, exiting the build.`\n )\n process.exit(1)\n } else {\n // Otherwise, this is a no-op. The build will continue, and a summary of failed pages will be displayed at the end.\n }\n } else {\n // Otherwise, we have more attempts to make. Wait before retrying\n if (err instanceof TimeoutError) {\n console.info(\n `Failed to build ${pageKey} (attempt ${attempt + 1} of ${maxAttempts}) because it took more than ${nextConfig.staticPageGenerationTimeout} seconds. Retrying again shortly.`\n )\n } else {\n console.info(\n `Failed to build ${pageKey} (attempt ${attempt + 1} of ${maxAttempts}). Retrying again shortly.`\n )\n }\n\n // Exponential backoff with random jitter to avoid thundering herd on retries\n const baseDelay = 500 // 500ms\n const maxDelay = 2000 // 2 seconds\n const delay = Math.min(baseDelay * Math.pow(2, attempt), maxDelay)\n const jitter = Math.random() * 0.3 * delay // Add up to 30% random jitter\n await new Promise((r) => setTimeout(r, delay + jitter))\n }\n }\n\n attempt++\n }\n\n return { result, path, pageKey }\n }\n\n for (let i = 0; i < paths.length; i += maxConcurrency) {\n const subset = paths.slice(i, i + maxConcurrency)\n\n const subsetResults = await Promise.all(\n subset.map((path) =>\n exportPageWithRetry(\n path,\n nextConfig.experimental.staticGenerationRetryCount ?? 1\n )\n )\n )\n\n results.push(...subsetResults)\n }\n\n return results\n}\n\nasync function exportPage(\n input: ExportPageInput\n): Promise<ExportPageResult | undefined> {\n trace('export-page', input.parentSpanId).setAttribute('path', input.path)\n\n // Configure the http agent.\n setHttpClientAndAgentOptions({\n httpAgentOptions: input.httpAgentOptions,\n })\n\n const fileWriter = new MultiFileWriter({\n writeFile: (filePath, data) => fs.writeFile(filePath, data),\n mkdir: (dir) => fs.mkdir(dir, { recursive: true }),\n })\n\n const exportPageSpan = trace('export-page-worker', input.parentSpanId)\n\n const start = Date.now()\n\n const turborepoAccessTraceResult = new TurborepoAccessTraceResult()\n\n // Export the page.\n let result: ExportRouteResult | undefined\n try {\n result = await exportPageSpan.traceAsyncFn(() =>\n turborepoTraceAccess(\n () => exportPageImpl(input, fileWriter),\n turborepoAccessTraceResult\n )\n )\n\n // Wait for all the files to flush to disk.\n await fileWriter.wait()\n\n // If there was no result, then we can exit early.\n if (!result) return\n\n // If there was an error, then we can exit early.\n if ('error' in result) {\n return { error: result.error, duration: Date.now() - start }\n }\n } catch (err) {\n console.error(\n `Error occurred prerendering page \"${input.path}\". Read more: https://nextjs.org/docs/messages/prerender-error`\n )\n\n // bailoutToCSRError errors should not leak to the user as they are not actionable; they're\n // a framework signal\n if (!isBailoutToCSRError(err)) {\n // A static generation bailout error is a framework signal to fail static generation but\n // and will encode a reason in the error message. If there is a message, we'll print it.\n // Otherwise there's nothing to show as we don't want to leak an error internal error stack to the user.\n // TODO: Always log the full error. ignore-listing will take care of hiding internal stacks.\n if (isStaticGenBailoutError(err)) {\n if (err.message) {\n console.error(`Error: ${err.message}`)\n }\n } else {\n console.error(err)\n }\n }\n\n return { error: true, duration: Date.now() - start }\n }\n\n // Notify the parent process that we processed a page (used by the progress activity indicator)\n process.send?.([3, { type: 'activity' }])\n\n // Otherwise we can return the result.\n return {\n duration: Date.now() - start,\n ampValidations: result.ampValidations,\n cacheControl: result.cacheControl,\n metadata: result.metadata,\n ssgNotFound: result.ssgNotFound,\n hasEmptyStaticShell: result.hasEmptyStaticShell,\n hasPostponed: result.hasPostponed,\n turborepoAccessTraceResult: turborepoAccessTraceResult.serialize(),\n fetchMetrics: result.fetchMetrics,\n }\n}\n\nprocess.on('unhandledRejection', (err: unknown) => {\n // if it's a postpone error, it'll be handled later\n // when the postponed promise is actually awaited.\n if (isPostpone(err)) {\n return\n }\n\n // we don't want to log these errors\n if (isDynamicUsageError(err)) {\n return\n }\n\n console.error(err)\n})\n\nprocess.on('rejectionHandled', () => {\n // It is ok to await a Promise late in Next.js as it allows for better\n // prefetching patterns to avoid waterfalls. We ignore logging these.\n // We should've already errored in anyway unhandledRejection.\n})\n\nconst FATAL_UNHANDLED_NEXT_API_EXIT_CODE = 78\n\nprocess.on('uncaughtException', (err) => {\n if (isDynamicUsageError(err)) {\n console.error(\n 'A Next.js API that uses exceptions to signal framework behavior was uncaught. This suggests improper usage of a Next.js API. The original error is printed below and the build will now exit.'\n )\n console.error(err)\n process.exit(FATAL_UNHANDLED_NEXT_API_EXIT_CODE)\n } else {\n console.error(err)\n }\n})\n"],"names":["process","env","NEXT_IS_EXPORT_WORKER","extname","join","dirname","sep","fs","loadComponents","isDynamicRoute","normalizePagePath","normalizeLocalePath","trace","setHttpClientAndAgentOptions","addRequestMeta","normalizeAppPath","createRequestResponseMocks","isAppRouteRoute","hasNextSupport","exportAppRoute","exportAppPage","exportPagesPage","getParams","createIncrementalCache","isPostpone","isDynamicUsageError","isBailoutToCSRError","turborepoTraceAccess","TurborepoAccessTraceResult","getFallbackRouteParams","needsExperimentalReact","isStaticGenBailoutError","MultiFileWriter","envConfig","require","globalThis","__NEXT_DATA__","nextExport","TimeoutError","Error","code","ExportPageError","exportPageImpl","input","fileWriter","req","path","pathMap","distDir","pagesDataDir","buildExport","serverRuntimeConfig","subFolders","optimizeCss","disableOptimizedLoading","debugOutput","enableExperimentalReact","ampValidatorPath","trailingSlash","sriEnabled","__NEXT_EXPERIMENTAL_REACT","page","_fallbackRouteParams","_isAppDir","isAppDir","_isDynamicError","isDynamicError","_isRoutePPREnabled","isRoutePPREnabled","_allowEmptyStaticShell","allowEmptyStaticShell","query","originalQuery","fallbackRouteParams","pathname","isDynamic","outDir","filePath","ampPath","renderAmpPath","updatedPath","_ssgPath","locale","_locale","renderOpts","localePathResult","locales","detectedLocale","defaultLocale","hasOrigQueryValues","Object","keys","length","nonLocalizedPath","params","normalizedPage","res","url","statusCode","some","p","endsWith","domainLocales","dl","includes","setConfig","publicRuntimeConfig","runtimeConfig","getHtmlFilename","htmlFilename","pageExt","pathExt","isBuiltinPaths","isHtmlExtPath","baseDir","htmlFilepath","mkdir","recursive","components","isAppPath","isDev","routeModule","incrementalCache","cacheLifeProfiles","experimental","buildId","supportsDynamicResponse","serveStreamingMetadata","isRevalidate","sharedContext","deploymentId","customServer","undefined","renderContext","isFallback","_pagesFallback","isDraftMode","developmentNotFoundSourcePage","exportPages","exportPathMap","paths","dir","cacheHandler","cacheMaxMemorySize","fetchCacheKeyPrefix","nextConfig","options","enablePrerenderSourceMaps","stackTraceLimit","flushToDisk","cacheHandlers","maxConcurrency","staticGenerationMaxConcurrency","results","exportPageWithRetry","maxAttempts","pageKey","attempt","result","hasDebuggerAttached","NODE_OPTIONS","Promise","race","exportPage","amp","validator","parentSpanId","httpAgentOptions","Boolean","sri","algorithm","_","reject","setTimeout","staticPageGenerationTimeout","err","console","info","prerenderEarlyExit","error","exit","baseDelay","maxDelay","delay","Math","min","pow","jitter","random","r","i","subset","slice","subsetResults","all","map","staticGenerationRetryCount","push","setAttribute","writeFile","data","exportPageSpan","start","Date","now","turborepoAccessTraceResult","traceAsyncFn","wait","duration","message","send","type","ampValidations","cacheControl","metadata","ssgNotFound","hasEmptyStaticShell","hasPostponed","serialize","fetchMetrics","on","FATAL_UNHANDLED_NEXT_API_EXIT_CODE"],"mappings":"AASA,OAAO,6BAA4B;AAEnCA,QAAQC,GAAG,CAACC,qBAAqB,GAAG;AAEpC,SAASC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,GAAG,QAAQ,OAAM;AAClD,OAAOC,QAAQ,cAAa;AAC5B,SAASC,cAAc,QAAQ,4BAA2B;AAC1D,SAASC,cAAc,QAAQ,wCAAuC;AACtE,SAASC,iBAAiB,QAAQ,8CAA6C;AAC/E,SAASC,mBAAmB,QAAQ,2CAA0C;AAC9E,SAASC,KAAK,QAAQ,WAAU;AAChC,SAASC,4BAA4B,QAAQ,iCAAgC;AAC7E,SAASC,cAAc,QAAQ,yBAAwB;AACvD,SAASC,gBAAgB,QAAQ,uCAAsC;AAEvE,SAASC,0BAA0B,QAAQ,6BAA4B;AACvE,SAASC,eAAe,QAAQ,4BAA2B;AAC3D,SAASC,cAAc,QAAQ,oBAAmB;AAClD,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,aAAa,QA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AmD;IACnD,kDAAkD;IAClD,IAAIvJ,WAAWuJ,MAAM;QACnB;IACF;IAEA,oCAAoC;IACpC,IAAItJ,oBAAoBsJ,MAAM;QAC5B;IACF;IAEAC,QAAQG,KAAK,CAACJ;AAChB;AAEA/K,QAAQ4N,EAAE,CAAC,oBAAoB;AAC7B,sEAAsE;AACtE,qEAAqE;AACrE,6DAA6D;AAC/D;AAEA,MAAMC,qCAAqC;AAE3C7N,QAAQ4N,EAAE,CAAC,qBAAqB,CAAC7C;IAC/B,IAAItJ,oBAAoBsJ,MAAM;QAC5BC,QAAQG,KAAK,CACX;QAEFH,QAAQG,KAAK,CAACJ;QACd/K,QAAQoL,IAAI,CAACyC;IACf,OAAO;QACL7C,QAAQG,KAAK,CAACJ;IAChB;AACF","ignoreList":[0]}
@@ -25,7 +25,7 @@ import { normalizeAppPath } from '../shared/lib/router/utils/app-paths';
25
25
  import { getHostname } from '../shared/lib/get-hostname';
26
26
  import { parseUrl as parseUrlUtil } from '../shared/lib/router/utils/parse-url';
27
27
  import { getNextPathnameInfo } from '../shared/lib/router/utils/get-next-pathname-info';
28
- import { RSC_HEADER, NEXT_RSC_UNION_QUERY, NEXT_ROUTER_PREFETCH_HEADER, NEXT_ROUTER_SEGMENT_PREFETCH_HEADER, NEXT_DID_POSTPONE_HEADER, NEXT_URL, NEXT_IS_PRERENDER_HEADER } from '../client/components/app-router-headers';
28
+ import { RSC_HEADER, NEXT_RSC_UNION_QUERY, NEXT_ROUTER_PREFETCH_HEADER, NEXT_ROUTER_SEGMENT_PREFETCH_HEADER, NEXT_DID_POSTPONE_HEADER, NEXT_URL, NEXT_ROUTER_STATE_TREE_HEADER, NEXT_IS_PRERENDER_HEADER } from '../client/components/app-router-headers';
29
29
  import { LocaleRouteNormalizer } from './normalizers/locale-route-normalizer';
30
30
  import { DefaultRouteMatcherManager } from './route-matcher-managers/default-route-matcher-manager';
31
31
  import { AppPageRouteMatcherProvider } from './route-matcher-providers/app-page-route-matcher-provider';
@@ -1086,15 +1086,19 @@ export default class Server {
1086
1086
  });
1087
1087
  }
1088
1088
  setVaryHeader(req, res, isAppPath, resolvedPathname) {
1089
+ const baseVaryHeader = `${RSC_HEADER}, ${NEXT_ROUTER_STATE_TREE_HEADER}, ${NEXT_ROUTER_PREFETCH_HEADER}, ${NEXT_ROUTER_SEGMENT_PREFETCH_HEADER}`;
1090
+ const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? false;
1089
1091
  let addedNextUrlToVary = false;
1090
1092
  if (isAppPath && this.pathCouldBeIntercepted(resolvedPathname)) {
1091
1093
  // Interception route responses can vary based on the `Next-URL` header.
1092
1094
  // We use the Vary header to signal this behavior to the client to properly cache the response.
1093
- res.appendHeader('vary', `${NEXT_URL}`);
1095
+ res.appendHeader('vary', `${baseVaryHeader}, ${NEXT_URL}`);
1094
1096
  addedNextUrlToVary = true;
1097
+ } else if (isAppPath || isRSCRequest) {
1098
+ // We don't need to include `Next-URL` in the Vary header for non-interception routes since it won't affect the response.
1099
+ // We also set this header for pages to avoid caching issues when navigating between pages and app.
1100
+ res.appendHeader('vary', baseVaryHeader);
1095
1101
  }
1096
- // For other cases such as App Router requests or RSC requests we don't need to set vary header since we already
1097
- // have the _rsc query with the unique hash value.
1098
1102
  if (!addedNextUrlToVary) {
1099
1103
  // Remove `Next-URL` from the request headers we determined it wasn't necessary to include in the Vary header.
1100
1104
  // This is to avoid any dependency on the `Next-URL` header being present when preparing the response.