/
opt
/
canhelp
/
node_modules
/
next
/
dist
/
server
/
/opt/canhelp/node_modules/next/dist/server
mkdir
upload
Name
Size
Mode
Actions
after/
-
0755
rm
api-utils/
-
0755
rm
app-render/
-
0755
rm
async-storage/
-
0755
rm
base-http/
-
0755
rm
dev/
-
0755
rm
instrumentation/
-
0755
rm
lib/
-
0755
rm
node-environment-extensions/
-
0755
rm
normalizers/
-
0755
rm
og/
-
0755
rm
request/
-
0755
rm
response-cache/
-
0755
rm
resume-data-cache/
-
0755
rm
route-definitions/
-
0755
rm
route-matcher-managers/
-
0755
rm
route-matcher-providers/
-
0755
rm
route-matchers/
-
0755
rm
route-matches/
-
0755
rm
route-modules/
-
0755
rm
stream-utils/
-
0755
rm
typescript/
-
0755
rm
use-cache/
-
0755
rm
web/
-
0755
rm
accept-header.d.ts
98
0644
edit
dl
rm
accept-header.js
4062
0644
edit
dl
rm
accept-header.js.map
6474
0644
edit
dl
rm
base-server.d.ts
14818
0644
edit
dl
rm
base-server.js
101770
0644
edit
dl
rm
base-server.js.map
162683
0644
edit
dl
rm
body-streams.d.ts
474
0644
edit
dl
rm
body-streams.js
3655
0644
edit
dl
rm
body-streams.js.map
5442
0644
edit
dl
rm
cache-dir.d.ts
82
0644
edit
dl
rm
cache-dir.js
757
0644
edit
dl
rm
cache-dir.js.map
703
0644
edit
dl
rm
capsize-font-metrics.json
4301622
0644
edit
dl
rm
ci-info.d.ts
124
0644
edit
dl
rm
ci-info.js
1142
0644
edit
dl
rm
ci-info.js.map
1314
0644
edit
dl
rm
client-component-renderer-logger.d.ts
405
0644
edit
dl
rm
client-component-renderer-logger.js
2287
0644
edit
dl
rm
client-component-renderer-logger.js.map
3036
0644
edit
dl
rm
config-schema.d.ts
151
0644
edit
dl
rm
config-schema.js
30336
0644
edit
dl
rm
config-schema.js.map
56748
0644
edit
dl
rm
config-shared.d.ts
49280
0644
edit
dl
rm
config-shared.js
7278
0644
edit
dl
rm
config-shared.js.map
58064
0644
edit
dl
rm
config-utils.d.ts
49
0644
edit
dl
rm
config-utils.js
5888
0644
edit
dl
rm
config-utils.js.map
6600
0644
edit
dl
rm
config.d.ts
1159
0644
edit
dl
rm
config.js
74313
0644
edit
dl
rm
config.js.map
99560
0644
edit
dl
rm
create-deduped-by-callsite-server-error-logger.d.ts
591
0644
edit
dl
rm
create-deduped-by-callsite-server-error-logger.js
3584
0644
edit
dl
rm
create-deduped-by-callsite-server-error-logger.js.map
3667
0644
edit
dl
rm
crypto-utils.d.ts
171
0644
edit
dl
rm
crypto-utils.js
3026
0644
edit
dl
rm
crypto-utils.js.map
4369
0644
edit
dl
rm
dynamic-rendering-utils.d.ts
425
0644
edit
dl
rm
dynamic-rendering-utils.js
3388
0644
edit
dl
rm
dynamic-rendering-utils.js.map
4939
0644
edit
dl
rm
font-utils.d.ts
177
0644
edit
dl
rm
font-utils.js
1776
0644
edit
dl
rm
font-utils.js.map
3060
0644
edit
dl
rm
get-app-route-from-entrypoint.d.ts
85
0644
edit
dl
rm
get-app-route-from-entrypoint.js
832
0644
edit
dl
rm
get-app-route-from-entrypoint.js.map
865
0644
edit
dl
rm
get-page-files.d.ts
536
0644
edit
dl
rm
get-page-files.js
807
0644
edit
dl
rm
get-page-files.js.map
1692
0644
edit
dl
rm
get-route-from-entrypoint.d.ts
97
0644
edit
dl
rm
get-route-from-entrypoint.js
1245
0644
edit
dl
rm
get-route-from-entrypoint.js.map
1415
0644
edit
dl
rm
htmlescape.d.ts
110
0644
edit
dl
rm
htmlescape.js
986
0644
edit
dl
rm
htmlescape.js.map
1000
0644
edit
dl
rm
image-optimizer.d.ts
4692
0644
edit
dl
rm
image-optimizer.js
37066
0644
edit
dl
rm
image-optimizer.js.map
55523
0644
edit
dl
rm
internal-utils.d.ts
223
0644
edit
dl
rm
internal-utils.js
1127
0644
edit
dl
rm
internal-utils.js.map
1347
0644
edit
dl
rm
load-components.d.ts
2988
0644
edit
dl
rm
load-components.js
7016
0644
edit
dl
rm
load-components.js.map
13170
0644
edit
dl
rm
load-default-error-components.d.ts
1352
0644
edit
dl
rm
load-default-error-components.js
1887
0644
edit
dl
rm
load-default-error-components.js.map
3826
0644
edit
dl
rm
load-manifest.external.d.ts
1808
0644
edit
dl
rm
load-manifest.external.js
3051
0644
edit
dl
rm
load-manifest.external.js.map
5827
0644
edit
dl
rm
match-bundle.d.ts
82
0644
edit
dl
rm
match-bundle.js
686
0644
edit
dl
rm
match-bundle.js.map
718
0644
edit
dl
rm
next-server.d.ts
11448
0644
edit
dl
rm
next-server.js
69844
0644
edit
dl
rm
next-server.js.map
110019
0644
edit
dl
rm
next-typescript.d.ts
47
0644
edit
dl
rm
next-typescript.js
318
0644
edit
dl
rm
next-typescript.js.map
222
0644
edit
dl
rm
next.d.ts
3646
0644
edit
dl
rm
next.js
15707
0644
edit
dl
rm
next.js.map
26816
0644
edit
dl
rm
node-environment-baseline.d.ts
0
0644
edit
dl
rm
node-environment-baseline.js
890
0644
edit
dl
rm
node-environment-baseline.js.map
1555
0644
edit
dl
rm
node-environment.d.ts
287
0644
edit
dl
rm
node-environment.js
648
0644
edit
dl
rm
node-environment.js.map
1065
0644
edit
dl
rm
node-polyfill-crypto.d.ts
0
0644
edit
dl
rm
node-polyfill-crypto.js
558
0644
edit
dl
rm
node-polyfill-crypto.js.map
1014
0644
edit
dl
rm
optimize-amp.d.ts
78
0644
edit
dl
rm
optimize-amp.js
549
0644
edit
dl
rm
optimize-amp.js.map
839
0644
edit
dl
rm
patch-error-inspect.d.ts
467
0644
edit
dl
rm
patch-error-inspect.js
19653
0644
edit
dl
rm
patch-error-inspect.js.map
28501
0644
edit
dl
rm
pipe-readable.d.ts
291
0644
edit
dl
rm
pipe-readable.js
5598
0644
edit
dl
rm
pipe-readable.js.map
7677
0644
edit
dl
rm
post-process.d.ts
372
0644
edit
dl
rm
post-process.js
2006
0644
edit
dl
rm
post-process.js.map
3983
0644
edit
dl
rm
ReactDOMServerPages.d.ts
38
0644
edit
dl
rm
ReactDOMServerPages.js
598
0644
edit
dl
rm
ReactDOMServerPages.js.map
957
0644
edit
dl
rm
render-result.d.ts
6241
0644
edit
dl
rm
render-result.js
7555
0644
edit
dl
rm
render-result.js.map
14243
0644
edit
dl
rm
render.d.ts
4887
0644
edit
dl
rm
render.js
55784
0644
edit
dl
rm
render.js.map
85056
0644
edit
dl
rm
request-meta.d.ts
8031
0644
edit
dl
rm
request-meta.js
1465
0644
edit
dl
rm
request-meta.js.map
9461
0644
edit
dl
rm
require-hook.d.ts
266
0644
edit
dl
rm
require-hook.js
2840
0644
edit
dl
rm
require-hook.js.map
4453
0644
edit
dl
rm
require.d.ts
377
0644
edit
dl
rm
require.js
3922
0644
edit
dl
rm
require.js.map
6048
0644
edit
dl
rm
revalidation-utils.d.ts
541
0644
edit
dl
rm
revalidation-utils.js
3341
0644
edit
dl
rm
revalidation-utils.js.map
5733
0644
edit
dl
rm
route-kind.d.ts
720
0644
edit
dl
rm
route-kind.js
1029
0644
edit
dl
rm
route-kind.js.map
937
0644
edit
dl
rm
send-payload.d.ts
597
0644
edit
dl
rm
send-payload.js
2849
0644
edit
dl
rm
send-payload.js.map
4214
0644
edit
dl
rm
send-response.d.ts
420
0644
edit
dl
rm
send-response.js
3065
0644
edit
dl
rm
send-response.js.map
4559
0644
edit
dl
rm
serve-static.d.ts
403
0644
edit
dl
rm
serve-static.js
2110
0644
edit
dl
rm
serve-static.js.map
2680
0644
edit
dl
rm
server-route-utils.d.ts
197
0644
edit
dl
rm
server-route-utils.js
1130
0644
edit
dl
rm
server-route-utils.js.map
1935
0644
edit
dl
rm
server-utils.d.ts
3134
0644
edit
dl
rm
server-utils.js
16542
0644
edit
dl
rm
server-utils.js.map
26064
0644
edit
dl
rm
setup-http-agent-env.d.ts
172
0644
edit
dl
rm
setup-http-agent-env.js
1050
0644
edit
dl
rm
setup-http-agent-env.js.map
1406
0644
edit
dl
rm
utils.d.ts
332
0644
edit
dl
rm
utils.js
3208
0644
edit
dl
rm
utils.js.map
4181
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/next/dist/server/patch-error-inspect.js
(19653B)
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { patchErrorInspectEdgeLite: null, patchErrorInspectNodeJS: null, setBundlerFindSourceMapImplementation: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { patchErrorInspectEdgeLite: function() { return patchErrorInspectEdgeLite; }, patchErrorInspectNodeJS: function() { return patchErrorInspectNodeJS; }, setBundlerFindSourceMapImplementation: function() { return setBundlerFindSourceMapImplementation; } }); const _module = require("module"); const _path = /*#__PURE__*/ _interop_require_wildcard(require("path")); const _url = /*#__PURE__*/ _interop_require_wildcard(require("url")); const _sourcemap = require("next/dist/compiled/source-map"); const _sourcemaps = require("./lib/source-maps"); const _parsestack = require("./lib/parse-stack"); const _shared = require("../next-devtools/server/shared"); const _workunitasyncstorageexternal = require("./app-render/work-unit-async-storage.external"); const _picocolors = require("../lib/picocolors"); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interop_require_wildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = { __proto__: null }; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for(var key in obj){ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } // Find a source map using the bundler's API. // This is only a fallback for when Node.js fails to due to bugs e.g. https://github.com/nodejs/node/issues/52102 // TODO: Remove once all supported Node.js versions are fixed. // TODO(veil): Set from Webpack as well let bundlerFindSourceMapPayload = ()=>undefined; function setBundlerFindSourceMapImplementation(findSourceMapImplementation) { bundlerFindSourceMapPayload = findSourceMapImplementation; } function frameToString(methodName, sourceURL, line1, column1) { let sourceLocation = line1 !== null ? `:${line1}` : ''; if (column1 !== null && sourceLocation !== '') { sourceLocation += `:${column1}`; } let fileLocation; if (sourceURL !== null && sourceURL.startsWith('file://') && URL.canParse(sourceURL)) { // If not relative to CWD, the path is ambiguous to IDEs and clicking will prompt to select the file first. // In a multi-app repo, this leads to potentially larger file names but will make clicking snappy. // There's no tradeoff for the cases where `dir` in `next dev [dir]` is omitted // since relative to cwd is both the shortest and snappiest. fileLocation = _path.relative(process.cwd(), _url.fileURLToPath(sourceURL)); } else if (sourceURL !== null && sourceURL.startsWith('/')) { fileLocation = _path.relative(process.cwd(), sourceURL); } else { fileLocation = sourceURL; } return methodName ? ` at ${methodName} (${fileLocation}${sourceLocation})` : ` at ${fileLocation}${sourceLocation}`; } function computeErrorName(error) { // TODO: Node.js seems to use a different algorithm // class ReadonlyRequestCookiesError extends Error {}` would read `ReadonlyRequestCookiesError: [...]` // in the stack i.e. seems like under certain conditions it favors the constructor name. return error.name || 'Error'; } function prepareUnsourcemappedStackTrace(error, structuredStackTrace) { const name = computeErrorName(error); const message = error.message || ''; let stack = name + ': ' + message; for(let i = 0; i < structuredStackTrace.length; i++){ stack += '\n at ' + structuredStackTrace[i].toString(); } return stack; } function shouldIgnoreListGeneratedFrame(file) { return file.startsWith('node:') || file.includes('node_modules'); } function shouldIgnoreListOriginalFrame(file) { return file.includes('node_modules'); } function createUnsourcemappedFrame(frame) { return { stack: { file: frame.file, line1: frame.line1, column1: frame.column1, methodName: frame.methodName, arguments: frame.arguments, ignored: shouldIgnoreListGeneratedFrame(frame.file) }, code: null }; } function ignoreListAnonymousStackFramesIfSandwiched(sourceMappedFrames) { return (0, _sourcemaps.ignoreListAnonymousStackFramesIfSandwiched)(sourceMappedFrames, (frame)=>frame.stack.file === '<anonymous>', (frame)=>frame.stack.ignored, (frame)=>frame.stack.methodName, (frame)=>{ frame.stack.ignored = true; }); } /** * @param frame * @param sourceMapCache * @returns The original frame if not sourcemapped. */ function getSourcemappedFrameIfPossible(frame, sourceMapCache, inspectOptions) { var _frame_methodName_replace, _frame_methodName; const sourceMapCacheEntry = sourceMapCache.get(frame.file); let sourceMapConsumer; let sourceMapPayload; if (sourceMapCacheEntry === undefined) { let sourceURL = frame.file; // e.g. "/APP/.next/server/chunks/ssr/[root-of-the-server]__2934a0._.js" // will be keyed by Node.js as "file:///APP/.next/server/chunks/ssr/[root-of-the-server]__2934a0._.js". // This is likely caused by `callsite.toString()` in `Error.prepareStackTrace converting file URLs to paths. if (sourceURL.startsWith('/')) { sourceURL = _url.pathToFileURL(frame.file).toString(); } let maybeSourceMapPayload; try { const sourceMap = (0, _module.findSourceMap)(sourceURL); maybeSourceMapPayload = sourceMap == null ? void 0 : sourceMap.payload; } catch (cause) { // We should not log an actual error instance here because that will re-enter // this codepath during error inspection and could lead to infinite recursion. console.error(`${sourceURL}: Invalid source map. Only conformant source maps can be used to find the original code. Cause: ${cause}`); // If loading fails once, it'll fail every time. // So set the cache to avoid duplicate errors. sourceMapCache.set(frame.file, null); // Don't even fall back to the bundler because it might be not as strict // with regards to parsing and then we fail later once we consume the // source map payload. // This essentially avoids a redundant error where we fail here and then // later on consumption because the bundler just handed back an invalid // source map. return createUnsourcemappedFrame(frame); } if (maybeSourceMapPayload === undefined) { maybeSourceMapPayload = bundlerFindSourceMapPayload(sourceURL); } if (maybeSourceMapPayload === undefined) { return createUnsourcemappedFrame(frame); } sourceMapPayload = maybeSourceMapPayload; try { sourceMapConsumer = new _sourcemap.SourceMapConsumer(// @ts-expect-error -- Module.SourceMap['version'] is number but SyncSourceMapConsumer wants a string sourceMapPayload); } catch (cause) { // We should not log an actual error instance here because that will re-enter // this codepath during error inspection and could lead to infinite recursion. console.error(`${sourceURL}: Invalid source map. Only conformant source maps can be used to find the original code. Cause: ${cause}`); // If creating the consumer fails once, it'll fail every time. // So set the cache to avoid duplicate errors. sourceMapCache.set(frame.file, null); return createUnsourcemappedFrame(frame); } sourceMapCache.set(frame.file, { map: sourceMapConsumer, payload: sourceMapPayload }); } else if (sourceMapCacheEntry === null) { // We failed earlier getting the payload or consumer. // Just return an unsourcemapped frame. // Errors will already be logged. return createUnsourcemappedFrame(frame); } else { sourceMapConsumer = sourceMapCacheEntry.map; sourceMapPayload = sourceMapCacheEntry.payload; } const sourcePosition = sourceMapConsumer.originalPositionFor({ column: (frame.column1 ?? 1) - 1, line: frame.line1 ?? 1 }); const applicableSourceMap = (0, _sourcemaps.findApplicableSourceMapPayload)((frame.line1 ?? 1) - 1, (frame.column1 ?? 1) - 1, sourceMapPayload); let ignored = applicableSourceMap !== undefined && (0, _sourcemaps.sourceMapIgnoreListsEverything)(applicableSourceMap); if (sourcePosition.source === null) { return { stack: { arguments: frame.arguments, file: frame.file, line1: frame.line1, column1: frame.column1, methodName: frame.methodName, ignored: ignored || shouldIgnoreListGeneratedFrame(frame.file) }, code: null }; } // TODO(veil): Upstream a method to sourcemap consumer that immediately says if a frame is ignored or not. if (applicableSourceMap === undefined) { console.error('No applicable source map found in sections for frame', frame); } else if (!ignored && shouldIgnoreListOriginalFrame(sourcePosition.source)) { // Externals may be libraries that don't ship ignoreLists. // This is really taking control away from libraries. // They should still ship `ignoreList` so that attached debuggers ignore-list their frames. // TODO: Maybe only ignore library sourcemaps if `ignoreList` is absent? // Though keep in mind that Turbopack omits empty `ignoreList`. // So if we establish this convention, we should communicate it to the ecosystem. ignored = true; } else if (!ignored) { var _applicableSourceMap_ignoreList; // TODO: O(n^2). Consider moving `ignoreList` into a Set const sourceIndex = applicableSourceMap.sources.indexOf(sourcePosition.source); ignored = ((_applicableSourceMap_ignoreList = applicableSourceMap.ignoreList) == null ? void 0 : _applicableSourceMap_ignoreList.includes(sourceIndex)) ?? false; } const originalFrame = { // We ignore the sourcemapped name since it won't be the correct name. // The callsite will point to the column of the variable name instead of the // name of the enclosing function. // TODO(NDX-531): Spy on prepareStackTrace to get the enclosing line number for method name mapping. methodName: (_frame_methodName = frame.methodName) == null ? void 0 : (_frame_methodName_replace = _frame_methodName.replace('__WEBPACK_DEFAULT_EXPORT__', 'default')) == null ? void 0 : _frame_methodName_replace.replace('__webpack_exports__.', ''), file: sourcePosition.source, line1: sourcePosition.line, column1: sourcePosition.column + 1, // TODO: c&p from async createOriginalStackFrame but why not frame.arguments? arguments: [], ignored }; /** undefined = not yet computed*/ let codeFrame; return Object.defineProperty({ stack: originalFrame, code: null }, 'code', { get: ()=>{ if (codeFrame === undefined) { const sourceContent = sourceMapConsumer.sourceContentFor(sourcePosition.source, /* returnNullOnMissing */ true) ?? null; codeFrame = (0, _shared.getOriginalCodeFrame)(originalFrame, sourceContent, inspectOptions.colors); } return codeFrame; } }); } function parseAndSourceMap(error, inspectOptions) { // TODO(veil): Expose as CLI arg or config option. Useful for local debugging. const showIgnoreListed = false; // We overwrote Error.prepareStackTrace earlier so error.stack is not sourcemapped. let unparsedStack = String(error.stack); // We could just read it from `error.stack`. // This works around cases where a 3rd party `Error.prepareStackTrace` implementation // doesn't implement the name computation correctly. const errorName = computeErrorName(error); let idx = unparsedStack.indexOf('react_stack_bottom_frame'); if (idx !== -1) { idx = unparsedStack.lastIndexOf('\n', idx); } else { idx = unparsedStack.indexOf('react-stack-bottom-frame'); if (idx !== -1) { idx = unparsedStack.lastIndexOf('\n', idx); } } if (idx !== -1 && !showIgnoreListed) { // Cut off everything after the bottom frame since it'll be React internals. unparsedStack = unparsedStack.slice(0, idx); } const unsourcemappedStack = (0, _parsestack.parseStack)(unparsedStack); const sourceMapCache = new Map(); const sourceMappedFrames = []; let sourceFrame = null; for (const frame of unsourcemappedStack){ if (frame.file === null) { sourceMappedFrames.push({ code: null, stack: { file: frame.file, line1: frame.line1, column1: frame.column1, methodName: frame.methodName, arguments: frame.arguments, ignored: false } }); } else { const sourcemappedFrame = getSourcemappedFrameIfPossible(// We narrowed this earlier by bailing if `frame.file` is null. frame, sourceMapCache, inspectOptions); sourceMappedFrames.push(sourcemappedFrame); // We can determine the sourceframe here. // anonymous frames won't have a sourceframe so we don't need to scan // all stacks again to check if they are sandwiched between ignored frames. if (sourceFrame === null && // TODO: Is this the right choice? !sourcemappedFrame.stack.ignored && sourcemappedFrame.code !== null) { sourceFrame = sourcemappedFrame.code; } } } ignoreListAnonymousStackFramesIfSandwiched(sourceMappedFrames); let sourceMappedStack = ''; for(let i = 0; i < sourceMappedFrames.length; i++){ const frame = sourceMappedFrames[i]; if (!frame.stack.ignored) { sourceMappedStack += '\n' + frameToString(frame.stack.methodName, frame.stack.file, frame.stack.line1, frame.stack.column1); } else if (showIgnoreListed) { sourceMappedStack += '\n' + (0, _picocolors.dim)(frameToString(frame.stack.methodName, frame.stack.file, frame.stack.line1, frame.stack.column1)); } } return errorName + ': ' + error.message + sourceMappedStack + (sourceFrame !== null ? '\n' + sourceFrame : ''); } function sourceMapError(error, inspectOptions) { // Create a new Error object with the source mapping applied and then use native // Node.js formatting on the result. const newError = error.cause !== undefined ? Object.defineProperty(new Error(error.message, { cause: error.cause }), "__NEXT_ERROR_CODE", { value: "E394", enumerable: false, configurable: true }) : Object.defineProperty(new Error(error.message), "__NEXT_ERROR_CODE", { value: "E394", enumerable: false, configurable: true }); // TODO: Ensure `class MyError extends Error {}` prints `MyError` as the name newError.stack = parseAndSourceMap(error, inspectOptions); for(const key in error){ if (!Object.prototype.hasOwnProperty.call(newError, key)) { // @ts-expect-error -- We're copying all enumerable properties. // So they definitely exist on `this` and obviously have no type on `newError` (yet) newError[key] = error[key]; } } return newError; } function patchErrorInspectNodeJS(errorConstructor) { const inspectSymbol = Symbol.for('nodejs.util.inspect.custom'); errorConstructor.prepareStackTrace = prepareUnsourcemappedStackTrace; // @ts-expect-error -- TODO upstream types // eslint-disable-next-line no-extend-native -- We're not extending but overriding. errorConstructor.prototype[inspectSymbol] = function(depth, inspectOptions, inspect) { // avoid false-positive dynamic i/o warnings e.g. due to usage of `Math.random` in `source-map`. return _workunitasyncstorageexternal.workUnitAsyncStorage.exit(()=>{ const newError = sourceMapError(this, inspectOptions); const originalCustomInspect = newError[inspectSymbol]; // Prevent infinite recursion. // { customInspect: false } would result in `error.cause` not using our inspect. Object.defineProperty(newError, inspectSymbol, { value: undefined, enumerable: false, writable: true }); try { return inspect(newError, { ...inspectOptions, depth: (inspectOptions.depth ?? // Default in Node.js 2) - depth }); } finally{ ; newError[inspectSymbol] = originalCustomInspect; } }); }; } function patchErrorInspectEdgeLite(errorConstructor) { const inspectSymbol = Symbol.for('edge-runtime.inspect.custom'); errorConstructor.prepareStackTrace = prepareUnsourcemappedStackTrace; // @ts-expect-error -- TODO upstream types // eslint-disable-next-line no-extend-native -- We're not extending but overriding. errorConstructor.prototype[inspectSymbol] = function({ format }) { // avoid false-positive dynamic i/o warnings e.g. due to usage of `Math.random` in `source-map`. return _workunitasyncstorageexternal.workUnitAsyncStorage.exit(()=>{ const newError = sourceMapError(this, {}); const originalCustomInspect = newError[inspectSymbol]; // Prevent infinite recursion. Object.defineProperty(newError, inspectSymbol, { value: undefined, enumerable: false, writable: true }); try { return format(newError); } finally{ ; newError[inspectSymbol] = originalCustomInspect; } }); }; } //# sourceMappingURL=patch-error-inspect.js.map
Save
cmd:
run