/home/techb158/balavpn.abdallabala.com/node_modules/next/dist/server
NameSizeModeActions
after/-0777rm
api-utils/-0777rm
app-render/-0777rm
async-storage/-0777rm
base-http/-0777rm
dev/-0777rm
instrumentation/-0777rm
lib/-0777rm
node-environment-extensions/-0777rm
normalizers/-0777rm
og/-0777rm
request/-0777rm
response-cache/-0777rm
resume-data-cache/-0777rm
route-definitions/-0777rm
route-matcher-managers/-0777rm
route-matcher-providers/-0777rm
route-matchers/-0777rm
route-matches/-0777rm
route-modules/-0777rm
stream-utils/-0777rm
typescript/-0777rm
use-cache/-0777rm
web/-0777rm
accept-header.d.ts980666editdlrm
accept-header.js40620666editdlrm
accept-header.js.map64740666editdlrm
base-server.d.ts148180666editdlrm
base-server.js1024910666editdlrm
base-server.js.map1637210666editdlrm
body-streams.d.ts4740666editdlrm
body-streams.js36550666editdlrm
body-streams.js.map54420666editdlrm
cache-dir.d.ts820666editdlrm
cache-dir.js7570666editdlrm
cache-dir.js.map7030666editdlrm
capsize-font-metrics.json43016220666editdlrm
ci-info.d.ts1240666editdlrm
ci-info.js11420666editdlrm
ci-info.js.map13140666editdlrm
client-component-renderer-logger.d.ts4050666editdlrm
client-component-renderer-logger.js22870666editdlrm
client-component-renderer-logger.js.map30360666editdlrm
config-schema.d.ts1510666editdlrm
config-schema.js303360666editdlrm
config-schema.js.map567480666editdlrm
config-shared.d.ts492800666editdlrm
config-shared.js72780666editdlrm
config-shared.js.map580640666editdlrm
config-utils.d.ts490666editdlrm
config-utils.js58880666editdlrm
config-utils.js.map66000666editdlrm
config.d.ts11590666editdlrm
config.js743130666editdlrm
config.js.map995600666editdlrm
create-deduped-by-callsite-server-error-logger.d.ts5910666editdlrm
create-deduped-by-callsite-server-error-logger.js35840666editdlrm
create-deduped-by-callsite-server-error-logger.js.map36670666editdlrm
crypto-utils.d.ts1710666editdlrm
crypto-utils.js30260666editdlrm
crypto-utils.js.map43690666editdlrm
dynamic-rendering-utils.d.ts4250666editdlrm
dynamic-rendering-utils.js33880666editdlrm
dynamic-rendering-utils.js.map49390666editdlrm
font-utils.d.ts1770666editdlrm
font-utils.js17760666editdlrm
font-utils.js.map30600666editdlrm
get-app-route-from-entrypoint.d.ts850666editdlrm
get-app-route-from-entrypoint.js8320666editdlrm
get-app-route-from-entrypoint.js.map8650666editdlrm
get-page-files.d.ts5360666editdlrm
get-page-files.js8070666editdlrm
get-page-files.js.map16920666editdlrm
get-route-from-entrypoint.d.ts970666editdlrm
get-route-from-entrypoint.js12450666editdlrm
get-route-from-entrypoint.js.map14150666editdlrm
image-optimizer.d.ts47210666editdlrm
image-optimizer.js380460666editdlrm
image-optimizer.js.map566470666editdlrm
internal-utils.d.ts2230666editdlrm
internal-utils.js11270666editdlrm
internal-utils.js.map13470666editdlrm
load-components.d.ts29880666editdlrm
load-components.js70160666editdlrm
load-components.js.map131700666editdlrm
load-default-error-components.d.ts13520666editdlrm
load-default-error-components.js18870666editdlrm
load-default-error-components.js.map38260666editdlrm
load-manifest.external.d.ts18080666editdlrm
load-manifest.external.js30510666editdlrm
load-manifest.external.js.map58270666editdlrm
match-bundle.d.ts820666editdlrm
match-bundle.js6860666editdlrm
match-bundle.js.map7180666editdlrm
next-server.d.ts114480666editdlrm
next-server.js700380666editdlrm
next-server.js.map1103260666editdlrm
next-typescript.d.ts470666editdlrm
next-typescript.js3180666editdlrm
next-typescript.js.map2220666editdlrm
next.d.ts36460666editdlrm
next.js157070666editdlrm
next.js.map268160666editdlrm
node-environment-baseline.d.ts00666editdlrm
node-environment-baseline.js8900666editdlrm
node-environment-baseline.js.map15550666editdlrm
node-environment.d.ts2870666editdlrm
node-environment.js6480666editdlrm
node-environment.js.map10650666editdlrm
node-polyfill-crypto.d.ts00666editdlrm
node-polyfill-crypto.js5580666editdlrm
node-polyfill-crypto.js.map10140666editdlrm
optimize-amp.d.ts780666editdlrm
optimize-amp.js5490666editdlrm
optimize-amp.js.map8390666editdlrm
patch-error-inspect.d.ts4670666editdlrm
patch-error-inspect.js196530666editdlrm
patch-error-inspect.js.map285010666editdlrm
pipe-readable.d.ts2910666editdlrm
pipe-readable.js55980666editdlrm
pipe-readable.js.map76770666editdlrm
post-process.d.ts3720666editdlrm
post-process.js20060666editdlrm
post-process.js.map39830666editdlrm
ReactDOMServerPages.d.ts380666editdlrm
ReactDOMServerPages.js5980666editdlrm
ReactDOMServerPages.js.map9570666editdlrm
render-result.d.ts62410666editdlrm
render-result.js75550666editdlrm
render-result.js.map142430666editdlrm
render.d.ts48870666editdlrm
render.js557840666editdlrm
render.js.map850560666editdlrm
request-meta.d.ts80310666editdlrm
request-meta.js14650666editdlrm
request-meta.js.map94610666editdlrm
require-hook.d.ts2660666editdlrm
require-hook.js28400666editdlrm
require-hook.js.map44530666editdlrm
require.d.ts3770666editdlrm
require.js39220666editdlrm
require.js.map60480666editdlrm
revalidation-utils.d.ts5410666editdlrm
revalidation-utils.js33410666editdlrm
revalidation-utils.js.map57330666editdlrm
route-kind.d.ts7200666editdlrm
route-kind.js10290666editdlrm
route-kind.js.map9370666editdlrm
send-payload.d.ts5970666editdlrm
send-payload.js28490666editdlrm
send-payload.js.map42140666editdlrm
send-response.d.ts4200666editdlrm
send-response.js30650666editdlrm
send-response.js.map45590666editdlrm
serve-static.d.ts4030666editdlrm
serve-static.js21100666editdlrm
serve-static.js.map26800666editdlrm
server-route-utils.d.ts1970666editdlrm
server-route-utils.js11300666editdlrm
server-route-utils.js.map19350666editdlrm
server-utils.d.ts31340666editdlrm
server-utils.js165420666editdlrm
server-utils.js.map260640666editdlrm
setup-http-agent-env.d.ts1720666editdlrm
setup-http-agent-env.js10500666editdlrm
setup-http-agent-env.js.map14060666editdlrm
utils.d.ts3320666editdlrm
utils.js32080666editdlrm
utils.js.map41810666editdlrm
Edit: /home/techb158/balavpn.abdallabala.com/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 === '', (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