main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
import type { webpack } from 'next/dist/compiled/webpack/webpack';
export declare function formatModuleTrace(compiler: webpack.Compiler, moduleTrace: any[]): {
lastInternalFileName: string;
invalidImportMessage: string;
formattedModuleTrace: string;
};
export declare function getModuleTrace(module: any, compilation: webpack.Compilation, compiler: webpack.Compiler): {
moduleTrace: any[];
isPagesDir: boolean;
};

View File

@@ -0,0 +1,89 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
formatModuleTrace: null,
getModuleTrace: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
formatModuleTrace: function() {
return formatModuleTrace;
},
getModuleTrace: function() {
return getModuleTrace;
}
});
const _loaderutils3 = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/loader-utils3"));
const _path = require("path");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function formatModule(compiler, module1) {
const relativePath = (0, _path.relative)(compiler.context, module1.resource).replace(/\?.+$/, "");
return _loaderutils3.default.isUrlRequest(relativePath) ? _loaderutils3.default.urlToRequest(relativePath) : relativePath;
}
function formatModuleTrace(compiler, moduleTrace) {
let importTrace = [];
let firstExternalModule;
for(let i = moduleTrace.length - 1; i >= 0; i--){
const mod = moduleTrace[i];
if (!mod.resource) continue;
if (!mod.resource.includes("node_modules/")) {
importTrace.unshift(formatModule(compiler, mod));
} else {
firstExternalModule = mod;
break;
}
}
let invalidImportMessage = "";
if (firstExternalModule) {
var _firstExternalModule_resourceResolveData_descriptionFileData, _firstExternalModule_resourceResolveData;
const firstExternalPackageName = (_firstExternalModule_resourceResolveData = firstExternalModule.resourceResolveData) == null ? void 0 : (_firstExternalModule_resourceResolveData_descriptionFileData = _firstExternalModule_resourceResolveData.descriptionFileData) == null ? void 0 : _firstExternalModule_resourceResolveData_descriptionFileData.name;
if (firstExternalPackageName === "styled-jsx") {
invalidImportMessage += `\n\nThe error was caused by using 'styled-jsx' in '${importTrace[0]}'. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.`;
} else {
let formattedExternalFile = firstExternalModule.resource.split("node_modules");
formattedExternalFile = formattedExternalFile[formattedExternalFile.length - 1];
invalidImportMessage += `\n\nThe error was caused by importing '${formattedExternalFile.slice(1)}' in '${importTrace[0]}'.`;
}
}
return {
lastInternalFileName: importTrace[0],
invalidImportMessage,
formattedModuleTrace: `${importTrace.map((mod)=>" " + mod).join("\n")}`
};
}
function getModuleTrace(module1, compilation, compiler) {
// Get the module trace:
// https://cs.github.com/webpack/webpack/blob/9fcaa243573005d6fdece9a3f8d89a0e8b399613/lib/stats/DefaultStatsFactoryPlugin.js#L414
const visitedModules = new Set();
const moduleTrace = [];
let current = module1;
let isPagesDir = false;
while(current){
if (visitedModules.has(current)) break;
if (/[\\/]pages/.test(current.resource.replace(compiler.context, ""))) {
isPagesDir = true;
}
visitedModules.add(current);
moduleTrace.push(current);
const origin = compilation.moduleGraph.getIssuer(current);
if (!origin) break;
current = origin;
}
return {
moduleTrace,
isPagesDir
};
}
//# sourceMappingURL=getModuleTrace.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/plugins/wellknown-errors-plugin/getModuleTrace.ts"],"names":["formatModuleTrace","getModuleTrace","formatModule","compiler","module","relativePath","relative","context","resource","replace","loaderUtils","isUrlRequest","urlToRequest","moduleTrace","importTrace","firstExternalModule","i","length","mod","includes","unshift","invalidImportMessage","firstExternalPackageName","resourceResolveData","descriptionFileData","name","formattedExternalFile","split","slice","lastInternalFileName","formattedModuleTrace","map","join","compilation","visitedModules","Set","current","isPagesDir","has","test","add","push","origin","moduleGraph","getIssuer"],"mappings":";;;;;;;;;;;;;;;IAcgBA,iBAAiB;eAAjBA;;IA4CAC,cAAc;eAAdA;;;qEAzDQ;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iB,GAAG,CAAC,CAACb,MAAQ,OAAOA,KAAKc,IAAI,CAAC,MAAM,CAAC;IAC5E;AACF;AAEO,SAAS/B,eACdG,OAAW,EACX6B,WAAgC,EAChC9B,QAA0B;IAE1B,wBAAwB;IACxB,kIAAkI;IAClI,MAAM+B,iBAAiB,IAAIC;IAC3B,MAAMtB,cAAc,EAAE;IAEtB,IAAIuB,UAAUhC;IACd,IAAIiC,aAAa;IACjB,MAAOD,QAAS;QACd,IAAIF,eAAeI,GAAG,CAACF,UAAU;QACjC,IAAI,aAAaG,IAAI,CAACH,QAAQ5B,QAAQ,CAACC,OAAO,CAACN,SAASI,OAAO,EAAE,MAAM;YACrE8B,aAAa;QACf;QACAH,eAAeM,GAAG,CAACJ;QACnBvB,YAAY4B,IAAI,CAACL;QACjB,MAAMM,SAAST,YAAYU,WAAW,CAACC,SAAS,CAACR;QACjD,IAAI,CAACM,QAAQ;QACbN,UAAUM;IACZ;IAEA,OAAO;QACL7B;QACAwB;IACF;AACF"}

View File

@@ -0,0 +1,4 @@
import type { webpack } from 'next/dist/compiled/webpack/webpack';
export declare class WellKnownErrorsPlugin {
apply(compiler: webpack.Compiler): void;
}

View File

@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "WellKnownErrorsPlugin", {
enumerable: true,
get: function() {
return WellKnownErrorsPlugin;
}
});
const _webpackModuleError = require("./webpackModuleError");
const NAME = "WellKnownErrorsPlugin";
class WellKnownErrorsPlugin {
apply(compiler) {
compiler.hooks.compilation.tap(NAME, (compilation)=>{
compilation.hooks.afterSeal.tapPromise(NAME, async ()=>{
var _compilation_errors;
if ((_compilation_errors = compilation.errors) == null ? void 0 : _compilation_errors.length) {
await Promise.all(compilation.errors.map(async (err, i)=>{
try {
const moduleError = await (0, _webpackModuleError.getModuleBuildError)(compiler, compilation, err);
if (moduleError !== false) {
compilation.errors[i] = moduleError;
}
} catch (e) {
console.log(e);
}
}));
}
});
});
}
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/plugins/wellknown-errors-plugin/index.ts"],"names":["WellKnownErrorsPlugin","NAME","apply","compiler","hooks","compilation","tap","afterSeal","tapPromise","errors","length","Promise","all","map","err","i","moduleError","getModuleBuildError","e","console","log"],"mappings":";;;;+BAKaA;;;eAAAA;;;oCAHuB;AAEpC,MAAMC,OAAO;AACN,MAAMD;IACXE,MAAMC,QAA0B,EAAE;QAChCA,SAASC,KAAK,CAACC,WAAW,CAACC,GAAG,CAACL,MAAM,CAACI;YACpCA,YAAYD,KAAK,CAACG,SAAS,CAACC,UAAU,CAACP,MAAM;oBACvCI;gBAAJ,KAAIA,sBAAAA,YAAYI,MAAM,qBAAlBJ,oBAAoBK,MAAM,EAAE;oBAC9B,MAAMC,QAAQC,GAAG,CACfP,YAAYI,MAAM,CAACI,GAAG,CAAC,OAAOC,KAAKC;wBACjC,IAAI;4BACF,MAAMC,cAAc,MAAMC,IAAAA,uCAAmB,EAC3Cd,UACAE,aACAS;4BAEF,IAAIE,gBAAgB,OAAO;gCACzBX,YAAYI,MAAM,CAACM,EAAE,GAAGC;4BAC1B;wBACF,EAAE,OAAOE,GAAG;4BACVC,QAAQC,GAAG,CAACF;wBACd;oBACF;gBAEJ;YACF;QACF;IACF;AACF"}

View File

@@ -0,0 +1,8 @@
import { SimpleWebpackError } from './simpleWebpackError';
export declare function getBabelError(fileName: string, err: Error & {
code?: string | number;
loc?: {
line: number;
column: number;
};
}): SimpleWebpackError | false;

View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getBabelError", {
enumerable: true,
get: function() {
return getBabelError;
}
});
const _chalk = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/chalk"));
const _simpleWebpackError = require("./simpleWebpackError");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
const chalk = new _chalk.default.constructor({
enabled: true
});
function getBabelError(fileName, err) {
if (err.code !== "BABEL_PARSE_ERROR") {
return false;
}
// https://github.com/babel/babel/blob/34693d6024da3f026534dd8d569f97ac0109602e/packages/babel-core/src/parser/index.js
if (err.loc) {
const lineNumber = Math.max(1, err.loc.line);
const column = Math.max(1, err.loc.column);
let message = err.message// Remove file information, which instead is provided by webpack.
.replace(/^.+?: /, "")// Remove column information from message
.replace(new RegExp(`[^\\S\\r\\n]*\\(${lineNumber}:${column}\\)[^\\S\\r\\n]*`), "");
return new _simpleWebpackError.SimpleWebpackError(`${chalk.cyan(fileName)}:${chalk.yellow(lineNumber.toString())}:${chalk.yellow(column.toString())}`, chalk.red.bold("Syntax error").concat(`: ${message}`));
}
return false;
}
//# sourceMappingURL=parseBabel.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/plugins/wellknown-errors-plugin/parseBabel.ts"],"names":["getBabelError","chalk","Chalk","constructor","enabled","fileName","err","code","loc","lineNumber","Math","max","line","column","message","replace","RegExp","SimpleWebpackError","cyan","yellow","toString","red","bold","concat"],"mappings":";;;;+BAKgBA;;;eAAAA;;;8DALE;oCACiB;;;;;;AAEnC,MAAMC,QAAQ,IAAIC,cAAK,CAACC,WAAW,CAAC;IAAEC,SAAS;AAAK;AAE7C,SAASJ,cACdK,QAAgB,EAChBC,GAGC;IAED,IAAIA,IAAIC,IAAI,KAAK,qBAAqB;QACpC,OAAO;IACT;IAEA,uHAAuH;IACvH,IAAID,IAAIE,GAAG,EAAE;QACX,MAAMC,aAAaC,KAAKC,GAAG,CAAC,GAAGL,IAAIE,GAAG,CAACI,IAAI;QAC3C,MAAMC,SAASH,KAAKC,GAAG,CAAC,GAAGL,IAAIE,GAAG,CAACK,MAAM;QAEzC,IAAIC,UAAUR,IAAIQ,OAAO,AACvB,iEAAiE;SAChEC,OAAO,CAAC,UAAU,GACnB,yCAAyC;SACxCA,OAAO,CACN,IAAIC,OAAO,CAAC,gBAAgB,EAAEP,WAAW,CAAC,EAAEI,OAAO,gBAAgB,CAAC,GACpE;QAGJ,OAAO,IAAII,sCAAkB,CAC3B,CAAC,EAAEhB,MAAMiB,IAAI,CAACb,UAAU,CAAC,EAAEJ,MAAMkB,MAAM,CACrCV,WAAWW,QAAQ,IACnB,CAAC,EAAEnB,MAAMkB,MAAM,CAACN,OAAOO,QAAQ,IAAI,CAAC,EACtCnB,MAAMoB,GAAG,CAACC,IAAI,CAAC,gBAAgBC,MAAM,CAAC,CAAC,EAAE,EAAET,QAAQ,CAAC;IAExD;IAEA,OAAO;AACT"}

View File

@@ -0,0 +1,2 @@
import { SimpleWebpackError } from './simpleWebpackError';
export declare function getCssError(fileName: string, err: Error): SimpleWebpackError | false;

View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getCssError", {
enumerable: true,
get: function() {
return getCssError;
}
});
const _chalk = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/chalk"));
const _simpleWebpackError = require("./simpleWebpackError");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
const chalk = new _chalk.default.constructor({
enabled: true
});
const regexCssError = /^(?:CssSyntaxError|SyntaxError)\n\n\((\d+):(\d*)\) (.*)$/s;
function getCssError(fileName, err) {
if (!((err.name === "CssSyntaxError" || err.name === "SyntaxError") && err.stack === false && !(err instanceof SyntaxError))) {
return false;
}
// https://github.com/postcss/postcss-loader/blob/d6931da177ac79707bd758436e476036a55e4f59/src/Error.js
const res = regexCssError.exec(err.message);
if (res) {
const [, _lineNumber, _column, reason] = res;
const lineNumber = Math.max(1, parseInt(_lineNumber, 10));
const column = Math.max(1, parseInt(_column, 10));
return new _simpleWebpackError.SimpleWebpackError(`${chalk.cyan(fileName)}:${chalk.yellow(lineNumber.toString())}:${chalk.yellow(column.toString())}`, chalk.red.bold("Syntax error").concat(`: ${reason}`));
}
return false;
}
//# sourceMappingURL=parseCss.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/plugins/wellknown-errors-plugin/parseCss.ts"],"names":["getCssError","chalk","Chalk","constructor","enabled","regexCssError","fileName","err","name","stack","SyntaxError","res","exec","message","_lineNumber","_column","reason","lineNumber","Math","max","parseInt","column","SimpleWebpackError","cyan","yellow","toString","red","bold","concat"],"mappings":";;;;+BAOgBA;;;eAAAA;;;8DAPE;oCACiB;;;;;;AAEnC,MAAMC,QAAQ,IAAIC,cAAK,CAACC,WAAW,CAAC;IAAEC,SAAS;AAAK;AACpD,MAAMC,gBACJ;AAEK,SAASL,YACdM,QAAgB,EAChBC,GAAU;IAEV,IACE,CACE,CAAA,AAACA,CAAAA,IAAIC,IAAI,KAAK,oBAAoBD,IAAIC,IAAI,KAAK,aAAY,KAC3D,AAACD,IAAYE,KAAK,KAAK,SACvB,CAAEF,CAAAA,eAAeG,WAAU,CAAC,GAE9B;QACA,OAAO;IACT;IAEA,uGAAuG;IAEvG,MAAMC,MAAMN,cAAcO,IAAI,CAACL,IAAIM,OAAO;IAC1C,IAAIF,KAAK;QACP,MAAM,GAAGG,aAAaC,SAASC,OAAO,GAAGL;QACzC,MAAMM,aAAaC,KAAKC,GAAG,CAAC,GAAGC,SAASN,aAAa;QACrD,MAAMO,SAASH,KAAKC,GAAG,CAAC,GAAGC,SAASL,SAAS;QAE7C,OAAO,IAAIO,sCAAkB,CAC3B,CAAC,EAAErB,MAAMsB,IAAI,CAACjB,UAAU,CAAC,EAAEL,MAAMuB,MAAM,CACrCP,WAAWQ,QAAQ,IACnB,CAAC,EAAExB,MAAMuB,MAAM,CAACH,OAAOI,QAAQ,IAAI,CAAC,EACtCxB,MAAMyB,GAAG,CAACC,IAAI,CAAC,gBAAgBC,MAAM,CAAC,CAAC,EAAE,EAAEZ,OAAO,CAAC;IAEvD;IAEA,OAAO;AACT"}

View File

@@ -0,0 +1,3 @@
import type { webpack } from 'next/dist/compiled/webpack/webpack';
import { SimpleWebpackError } from './simpleWebpackError';
export declare function getNextAppLoaderError(err: Error, module: any, compiler: webpack.Compiler): SimpleWebpackError | false;

View File

@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getNextAppLoaderError", {
enumerable: true,
get: function() {
return getNextAppLoaderError;
}
});
const _path = require("path");
const _simpleWebpackError = require("./simpleWebpackError");
function getNextAppLoaderError(err, module, compiler) {
try {
if (!module.loaders[0].loader.includes("next-app-loader.js")) {
return false;
}
const file = (0, _path.relative)(compiler.context, module.buildInfo.route.absolutePagePath);
return new _simpleWebpackError.SimpleWebpackError(file, err.message);
} catch {
return false;
}
}
//# sourceMappingURL=parseNextAppLoaderError.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.ts"],"names":["getNextAppLoaderError","err","module","compiler","loaders","loader","includes","file","relative","context","buildInfo","route","absolutePagePath","SimpleWebpackError","message"],"mappings":";;;;+BAIgBA;;;eAAAA;;;sBAHS;oCACU;AAE5B,SAASA,sBACdC,GAAU,EACVC,MAAW,EACXC,QAA0B;IAE1B,IAAI;QACF,IAAI,CAACD,OAAOE,OAAO,CAAC,EAAE,CAACC,MAAM,CAACC,QAAQ,CAAC,uBAAuB;YAC5D,OAAO;QACT;QAEA,MAAMC,OAAOC,IAAAA,cAAQ,EACnBL,SAASM,OAAO,EAChBP,OAAOQ,SAAS,CAACC,KAAK,CAACC,gBAAgB;QAGzC,OAAO,IAAIC,sCAAkB,CAACN,MAAMN,IAAIa,OAAO;IACjD,EAAE,OAAM;QACN,OAAO;IACT;AACF"}

View File

@@ -0,0 +1,2 @@
import { SimpleWebpackError } from './simpleWebpackError';
export declare function getNextFontError(err: Error, module: any): SimpleWebpackError | false;

View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getNextFontError", {
enumerable: true,
get: function() {
return getNextFontError;
}
});
const _simpleWebpackError = require("./simpleWebpackError");
function getNextFontError(err, module) {
try {
const resourceResolveData = module.resourceResolveData;
if (!module.loaders.find((loader)=>/next-font-loader[/\\]index.js/.test(loader.loader))) {
return false;
}
// Parse the query and get the path of the file where the font function was called.
// provided by next-swc next-transform-font
const file = JSON.parse(resourceResolveData.query.slice(1)).path;
if (err.name === "NextFontError") {
// Known error thrown by @next/font, display the error message
return new _simpleWebpackError.SimpleWebpackError(file, `\`next/font\` error:\n${err.message}`);
} else {
// Unknown error thrown by @next/font
return new _simpleWebpackError.SimpleWebpackError(file, `An error occured in \`next/font\`.\n\n${err.stack}`);
}
} catch {
return false;
}
}
//# sourceMappingURL=parseNextFontError.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/plugins/wellknown-errors-plugin/parseNextFontError.ts"],"names":["getNextFontError","err","module","resourceResolveData","loaders","find","loader","test","file","JSON","parse","query","slice","path","name","SimpleWebpackError","message","stack"],"mappings":";;;;+BAEgBA;;;eAAAA;;;oCAFmB;AAE5B,SAASA,iBACdC,GAAU,EACVC,MAAW;IAEX,IAAI;QACF,MAAMC,sBAAsBD,OAAOC,mBAAmB;QACtD,IACE,CAACD,OAAOE,OAAO,CAACC,IAAI,CAAC,CAACC,SACpB,gCAAgCC,IAAI,CAACD,OAAOA,MAAM,IAEpD;YACA,OAAO;QACT;QAEA,mFAAmF;QACnF,2CAA2C;QAC3C,MAAME,OAAOC,KAAKC,KAAK,CAACP,oBAAoBQ,KAAK,CAACC,KAAK,CAAC,IAAIC,IAAI;QAEhE,IAAIZ,IAAIa,IAAI,KAAK,iBAAiB;YAChC,8DAA8D;YAC9D,OAAO,IAAIC,sCAAkB,CAC3BP,MACA,CAAC,sBAAsB,EAAEP,IAAIe,OAAO,CAAC,CAAC;QAE1C,OAAO;YACL,qCAAqC;YACrC,OAAO,IAAID,sCAAkB,CAC3BP,MACA,CAAC,sCAAsC,EAAEP,IAAIgB,KAAK,CAAC,CAAC;QAExD;IACF,EAAE,OAAM;QACN,OAAO;IACT;AACF"}

View File

@@ -0,0 +1,3 @@
import type { webpack } from 'next/dist/compiled/webpack/webpack';
import { SimpleWebpackError } from './simpleWebpackError';
export declare function getNextInvalidImportError(err: Error, module: any, compilation: webpack.Compilation, compiler: webpack.Compiler): SimpleWebpackError | false;

View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getNextInvalidImportError", {
enumerable: true,
get: function() {
return getNextInvalidImportError;
}
});
const _getModuleTrace = require("./getModuleTrace");
const _simpleWebpackError = require("./simpleWebpackError");
function getNextInvalidImportError(err, module, compilation, compiler) {
try {
if (!module.loaders.find((loader)=>loader.loader.includes("next-invalid-import-error-loader.js"))) {
return false;
}
const { moduleTrace } = (0, _getModuleTrace.getModuleTrace)(module, compilation, compiler);
const { formattedModuleTrace, lastInternalFileName, invalidImportMessage } = (0, _getModuleTrace.formatModuleTrace)(compiler, moduleTrace);
return new _simpleWebpackError.SimpleWebpackError(lastInternalFileName, err.message + invalidImportMessage + "\n\nImport trace for requested module:\n" + formattedModuleTrace);
} catch {
return false;
}
}
//# sourceMappingURL=parseNextInvalidImportError.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/plugins/wellknown-errors-plugin/parseNextInvalidImportError.ts"],"names":["getNextInvalidImportError","err","module","compilation","compiler","loaders","find","loader","includes","moduleTrace","getModuleTrace","formattedModuleTrace","lastInternalFileName","invalidImportMessage","formatModuleTrace","SimpleWebpackError","message"],"mappings":";;;;+BAIgBA;;;eAAAA;;;gCAHkC;oCACf;AAE5B,SAASA,0BACdC,GAAU,EACVC,MAAW,EACXC,WAAgC,EAChCC,QAA0B;IAE1B,IAAI;QACF,IACE,CAACF,OAAOG,OAAO,CAACC,IAAI,CAAC,CAACC,SACpBA,OAAOA,MAAM,CAACC,QAAQ,CAAC,yCAEzB;YACA,OAAO;QACT;QAEA,MAAM,EAAEC,WAAW,EAAE,GAAGC,IAAAA,8BAAc,EAACR,QAAQC,aAAaC;QAC5D,MAAM,EAAEO,oBAAoB,EAAEC,oBAAoB,EAAEC,oBAAoB,EAAE,GACxEC,IAAAA,iCAAiB,EAACV,UAAUK;QAE9B,OAAO,IAAIM,sCAAkB,CAC3BH,sBACAX,IAAIe,OAAO,GACTH,uBACA,6CACAF;IAEN,EAAE,OAAM;QACN,OAAO;IACT;AACF"}

View File

@@ -0,0 +1,4 @@
import { SimpleWebpackError } from './simpleWebpackError';
import type { webpack } from 'next/dist/compiled/webpack/webpack';
export declare function getNotFoundError(compilation: webpack.Compilation, input: any, fileName: string, module: any): Promise<any>;
export declare function getImageError(compilation: any, input: any, err: Error): Promise<SimpleWebpackError | false>;

View File

@@ -0,0 +1,154 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
getNotFoundError: null,
getImageError: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
getNotFoundError: function() {
return getNotFoundError;
},
getImageError: function() {
return getImageError;
}
});
const _chalk = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/chalk"));
const _simpleWebpackError = require("./simpleWebpackError");
const _middleware = require("next/dist/compiled/@next/react-dev-overlay/dist/middleware");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
const chalk = new _chalk.default.constructor({
enabled: true
});
// Based on https://github.com/webpack/webpack/blob/fcdd04a833943394bbb0a9eeb54a962a24cc7e41/lib/stats/DefaultStatsFactoryPlugin.js#L422-L431
/*
Copyright JS Foundation and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ function getModuleTrace(input, compilation) {
const visitedModules = new Set();
const moduleTrace = [];
let current = input.module;
while(current){
if (visitedModules.has(current)) break; // circular (technically impossible, but who knows)
visitedModules.add(current);
const origin = compilation.moduleGraph.getIssuer(current);
if (!origin) break;
moduleTrace.push({
origin,
module: current
});
current = origin;
}
return moduleTrace;
}
async function getSourceFrame(input, fileName, compilation) {
try {
var _result_originalStackFrame_lineNumber, _result_originalStackFrame, _result_originalStackFrame_column, _result_originalStackFrame1;
const loc = input.loc ? input.loc : input.dependencies.map((d)=>d.loc).filter(Boolean)[0];
const originalSource = input.module.originalSource();
const result = await (0, _middleware.createOriginalStackFrame)({
line: loc.start.line,
column: loc.start.column,
source: originalSource,
rootDirectory: compilation.options.context,
modulePath: fileName,
frame: {}
});
return {
frame: (result == null ? void 0 : result.originalCodeFrame) ?? "",
lineNumber: (result == null ? void 0 : (_result_originalStackFrame = result.originalStackFrame) == null ? void 0 : (_result_originalStackFrame_lineNumber = _result_originalStackFrame.lineNumber) == null ? void 0 : _result_originalStackFrame_lineNumber.toString()) ?? "",
column: (result == null ? void 0 : (_result_originalStackFrame1 = result.originalStackFrame) == null ? void 0 : (_result_originalStackFrame_column = _result_originalStackFrame1.column) == null ? void 0 : _result_originalStackFrame_column.toString()) ?? ""
};
} catch {
return {
frame: "",
lineNumber: "",
column: ""
};
}
}
function getFormattedFileName(fileName, module1, lineNumber, column) {
var _module_loaders;
if ((_module_loaders = module1.loaders) == null ? void 0 : _module_loaders.find((loader)=>/next-font-loader[/\\]index.js/.test(loader.loader))) {
// Parse the query and get the path of the file where the font function was called.
// provided by next-swc next-transform-font
return JSON.parse(module1.resourceResolveData.query.slice(1)).path;
} else {
let formattedFileName = chalk.cyan(fileName);
if (lineNumber && column) {
formattedFileName += `:${chalk.yellow(lineNumber)}:${chalk.yellow(column)}`;
}
return formattedFileName;
}
}
async function getNotFoundError(compilation, input, fileName, module1) {
if (input.name !== "ModuleNotFoundError" && !(input.name === "ModuleBuildError" && /Error: Can't resolve '.+' in /.test(input.message))) {
return false;
}
try {
const { frame, lineNumber, column } = await getSourceFrame(input, fileName, compilation);
const errorMessage = input.error.message.replace(/ in '.*?'/, "").replace(/Can't resolve '(.*)'/, `Can't resolve '${chalk.green("$1")}'`);
const importTrace = ()=>{
const moduleTrace = getModuleTrace(input, compilation).map(({ origin })=>origin.readableIdentifier(compilation.requestShortener)).filter((name)=>name && !/next-(app|middleware|client-pages|route|flight-(client|server|client-entry))-loader\.js/.test(name) && !/next-route-loader\/index\.js/.test(name) && !/css-loader.+\.js/.test(name));
if (moduleTrace.length === 0) return "";
return `\nImport trace for requested module:\n${moduleTrace.join("\n")}`;
};
let message = chalk.red.bold("Module not found") + `: ${errorMessage}` + "\n" + frame + (frame !== "" ? "\n" : "") + "\nhttps://nextjs.org/docs/messages/module-not-found\n" + importTrace();
const formattedFileName = getFormattedFileName(fileName, module1, lineNumber, column);
return new _simpleWebpackError.SimpleWebpackError(formattedFileName, message);
} catch (err) {
// Don't fail on failure to resolve sourcemaps
return input;
}
}
async function getImageError(compilation, input, err) {
if (err.name !== "InvalidImageFormatError") {
return false;
}
const moduleTrace = getModuleTrace(input, compilation);
const { origin, module: module1 } = moduleTrace[0] || {};
if (!origin || !module1) {
return false;
}
const page = origin.rawRequest.replace(/^private-next-pages/, "./pages");
const importedFile = module1.rawRequest;
const source = origin.originalSource().buffer().toString("utf8");
let lineNumber = -1;
source.split("\n").some((line)=>{
lineNumber++;
return line.includes(importedFile);
});
return new _simpleWebpackError.SimpleWebpackError(`${chalk.cyan(page)}:${chalk.yellow(lineNumber.toString())}`, chalk.red.bold("Error").concat(`: Image import "${importedFile}" is not a valid image file. The image may be corrupted or an unsupported format.`));
}
//# sourceMappingURL=parseNotFoundError.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.ts"],"names":["getNotFoundError","getImageError","chalk","Chalk","constructor","enabled","getModuleTrace","input","compilation","visitedModules","Set","moduleTrace","current","module","has","add","origin","moduleGraph","getIssuer","push","getSourceFrame","fileName","result","loc","dependencies","map","d","filter","Boolean","originalSource","createOriginalStackFrame","line","start","column","source","rootDirectory","options","context","modulePath","frame","originalCodeFrame","lineNumber","originalStackFrame","toString","getFormattedFileName","loaders","find","loader","test","JSON","parse","resourceResolveData","query","slice","path","formattedFileName","cyan","yellow","name","message","errorMessage","error","replace","green","importTrace","readableIdentifier","requestShortener","length","join","red","bold","SimpleWebpackError","err","page","rawRequest","importedFile","buffer","split","some","includes","concat"],"mappings":";;;;;;;;;;;;;;;IAuGsBA,gBAAgB;eAAhBA;;IAqEAC,aAAa;eAAbA;;;8DA5KJ;oCACiB;4BACM;;;;;;AAGzC,MAAMC,QAAQ,IAAIC,cAAK,CAACC,WAAW,CAAC;IAAEC,SAAS;AAAK;AAEpD,6IAA6I;AAC7I;;;;;;;;;;;;;;;;;;;;;;AAsBA,GACA,SAASC,eAAeC,KAAU,EAAEC,WAAgB;IAClD,MAAMC,iBAAiB,IAAIC;IAC3B,MAAMC,cAAc,EAAE;IACtB,IAAIC,UAAUL,MAAMM,MAAM;IAC1B,MAAOD,QAAS;QACd,IAAIH,eAAeK,GAAG,CAACF,UAAU,OAAM,mDAAmD;QAC1FH,eAAeM,GAAG,CAACH;QACnB,MAAMI,SAASR,YAAYS,WAAW,CAACC,SAAS,CAACN;QACjD,IAAI,CAACI,QAAQ;QACbL,YAAYQ,IAAI,CAAC;YAAEH;YAAQH,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GAAG,CAACC,IAAI,CAAC,sBACf,CAAC,EAAE,EAAEV,aAAa,CAAC,GACnB,OACArB,QACCA,CAAAA,UAAU,KAAK,OAAO,EAAC,IACxB,0DACAyB;QAEF,MAAMT,oBAAoBX,qBACxBvB,UACAR,SACA4B,YACAR;QAGF,OAAO,IAAIsC,sCAAkB,CAAChB,mBAAmBI;IACnD,EAAE,OAAOa,KAAK;QACZ,8CAA8C;QAC9C,OAAOjE;IACT;AACF;AAEO,eAAeN,cACpBO,WAAgB,EAChBD,KAAU,EACViE,GAAU;IAEV,IAAIA,IAAId,IAAI,KAAK,2BAA2B;QAC1C,OAAO;IACT;IAEA,MAAM/C,cAAcL,eAAeC,OAAOC;IAC1C,MAAM,EAAEQ,MAAM,EAAEH,QAAAA,OAAM,EAAE,GAAGF,WAAW,CAAC,EAAE,IAAI,CAAC;IAC9C,IAAI,CAACK,UAAU,CAACH,SAAQ;QACtB,OAAO;IACT;IACA,MAAM4D,OAAOzD,OAAO0D,UAAU,CAACZ,OAAO,CAAC,uBAAuB;IAC9D,MAAMa,eAAe9D,QAAO6D,UAAU;IACtC,MAAMxC,SAASlB,OAAOa,cAAc,GAAG+C,MAAM,GAAGjC,QAAQ,CAAC;IACzD,IAAIF,aAAa,CAAC;IAClBP,OAAO2C,KAAK,CAAC,MAAMC,IAAI,CAAC,CAAC/C;QACvBU;QACA,OAAOV,KAAKgD,QAAQ,CAACJ;IACvB;IACA,OAAO,IAAIJ,sCAAkB,CAC3B,CAAC,EAAErE,MAAMsD,IAAI,CAACiB,MAAM,CAAC,EAAEvE,MAAMuD,MAAM,CAAChB,WAAWE,QAAQ,IAAI,CAAC,EAC5DzC,MAAMmE,GAAG,CACNC,IAAI,CAAC,SACLU,MAAM,CACL,CAAC,gBAAgB,EAAEL,aAAa,iFAAiF,CAAC;AAG1H"}

View File

@@ -0,0 +1,3 @@
import type { webpack } from 'next/dist/compiled/webpack/webpack';
import { SimpleWebpackError } from './simpleWebpackError';
export declare function getRscError(fileName: string, err: Error, module: any, compilation: webpack.Compilation, compiler: webpack.Compiler): SimpleWebpackError | false;

View File

@@ -0,0 +1,97 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getRscError", {
enumerable: true,
get: function() {
return getRscError;
}
});
const _getModuleTrace = require("./getModuleTrace");
const _simpleWebpackError = require("./simpleWebpackError");
function formatRSCErrorMessage(message, isPagesDir, fileName) {
let formattedMessage = message;
let formattedVerboseMessage = "";
// Comes from the "React Server Components" transform in SWC, always
// attach the module trace.
const NEXT_RSC_ERR_REACT_API = /.+NEXT_RSC_ERR_REACT_API: (.*?)\n/s;
const NEXT_RSC_ERR_SERVER_IMPORT = /.+NEXT_RSC_ERR_SERVER_IMPORT: (.*?)\n/s;
const NEXT_RSC_ERR_CLIENT_IMPORT = /.+NEXT_RSC_ERR_CLIENT_IMPORT: (.*?)\n/s;
const NEXT_RSC_ERR_CLIENT_METADATA_EXPORT = /.+NEXT_RSC_ERR_CLIENT_METADATA_EXPORT: (.*?)\n/s;
const NEXT_RSC_ERR_CONFLICT_METADATA_EXPORT = /NEXT_RSC_ERR_CONFLICT_METADATA_EXPORT/s;
const NEXT_RSC_ERR_CLIENT_DIRECTIVE = /.+NEXT_RSC_ERR_CLIENT_DIRECTIVE\n/s;
const NEXT_RSC_ERR_CLIENT_DIRECTIVE_PAREN = /.+NEXT_RSC_ERR_CLIENT_DIRECTIVE_PAREN\n/s;
const NEXT_RSC_ERR_INVALID_API = /.+NEXT_RSC_ERR_INVALID_API: (.*?)\n/s;
const NEXT_RSC_ERR_ERROR_FILE_SERVER_COMPONENT = /.+NEXT_RSC_ERR_ERROR_FILE_SERVER_COMPONENT/;
if (NEXT_RSC_ERR_REACT_API.test(message)) {
const matches = message.match(NEXT_RSC_ERR_REACT_API);
if (matches && matches[1] === "Component") {
formattedMessage = `\n\nYoure importing a class component. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.\nLearn more: https://nextjs.org/docs/getting-started/react-essentials#client-components\n\n`;
} else {
formattedMessage = message.replace(NEXT_RSC_ERR_REACT_API, `\n\nYou're importing a component that needs $1. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.\nLearn more: https://nextjs.org/docs/getting-started/react-essentials\n\n`);
}
formattedVerboseMessage = '\n\nMaybe one of these should be marked as a client entry with "use client":\n';
} else if (NEXT_RSC_ERR_SERVER_IMPORT.test(message)) {
let shouldAddUseClient = true;
const matches = message.match(NEXT_RSC_ERR_SERVER_IMPORT);
switch(matches && matches[1]){
case "react-dom/server":
// If importing "react-dom/server", we should show a different error.
formattedMessage = `\n\nYou're importing a component that imports react-dom/server. To fix it, render or return the content directly as a Server Component instead for perf and security.\nLearn more: https://nextjs.org/docs/getting-started/react-essentials`;
break;
case "next/router":
// If importing "next/router", we should tell them to use "next/navigation".
formattedMessage = `\n\nYou have a Server Component that imports next/router. Use next/navigation instead.\nLearn more: https://nextjs.org/docs/app/api-reference/functions/use-router`;
shouldAddUseClient = false;
break;
default:
formattedMessage = message.replace(NEXT_RSC_ERR_SERVER_IMPORT, `\n\nYou're importing a component that imports $1. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.\nLearn more: https://nextjs.org/docs/getting-started/react-essentials\n\n`);
}
formattedVerboseMessage = shouldAddUseClient ? '\n\nMaybe one of these should be marked as a client entry "use client":\n' : "\n\nImport trace:\n";
} else if (NEXT_RSC_ERR_CLIENT_IMPORT.test(message)) {
if (isPagesDir) {
formattedMessage = message.replace(NEXT_RSC_ERR_CLIENT_IMPORT, `\n\nYou're importing a component that needs $1. That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/getting-started/react-essentials#server-components\n\n`);
formattedVerboseMessage = "\n\nImport trace for requested module:\n";
} else {
formattedMessage = message.replace(NEXT_RSC_ERR_CLIENT_IMPORT, `\n\nYou're importing a component that needs $1. That only works in a Server Component but one of its parents is marked with "use client", so it's a Client Component.\nLearn more: https://nextjs.org/docs/getting-started/react-essentials\n\n`);
formattedVerboseMessage = '\n\nOne of these is marked as a client entry with "use client":\n';
}
} else if (NEXT_RSC_ERR_CLIENT_DIRECTIVE.test(message)) {
formattedMessage = message.replace(NEXT_RSC_ERR_CLIENT_DIRECTIVE, `\n\nThe "use client" directive must be placed before other expressions. Move it to the top of the file to resolve this issue.\n\n`);
formattedVerboseMessage = "\n\nImport path:\n";
} else if (NEXT_RSC_ERR_CLIENT_DIRECTIVE_PAREN.test(message)) {
formattedMessage = message.replace(NEXT_RSC_ERR_CLIENT_DIRECTIVE_PAREN, `\n\n"use client" must be a directive, and placed before other expressions. Remove the parentheses and move it to the top of the file to resolve this issue.\nLearn more: https://nextjs.org/docs/getting-started/react-essentials#the-use-client-directive\n\n`);
formattedVerboseMessage = "\n\nImport path:\n";
} else if (NEXT_RSC_ERR_INVALID_API.test(message)) {
formattedMessage = message.replace(NEXT_RSC_ERR_INVALID_API, `\n\n"$1" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching\n\n`);
formattedVerboseMessage = "\n\nFile path:\n";
} else if (NEXT_RSC_ERR_ERROR_FILE_SERVER_COMPONENT.test(message)) {
formattedMessage = message.replace(NEXT_RSC_ERR_ERROR_FILE_SERVER_COMPONENT, `\n\n${fileName} must be a Client Component. Add the "use client" directive the top of the file to resolve this issue.\nLearn more: https://nextjs.org/docs/getting-started/react-essentials#client-components\n\n`);
formattedVerboseMessage = "\n\nImport path:\n";
} else if (NEXT_RSC_ERR_CLIENT_METADATA_EXPORT.test(message)) {
formattedMessage = message.replace(NEXT_RSC_ERR_CLIENT_METADATA_EXPORT, `\n\nYou are attempting to export "$1" from a component marked with "use client", which is disallowed. Either remove the export, or the "use client" directive. Read more: https://nextjs.org/docs/getting-started/react-essentials#the-use-client-directive\n\n`);
formattedVerboseMessage = "\n\nFile path:\n";
} else if (NEXT_RSC_ERR_CONFLICT_METADATA_EXPORT.test(message)) {
formattedMessage = message.replace(NEXT_RSC_ERR_CONFLICT_METADATA_EXPORT, `\n\n"metadata" and "generateMetadata" cannot be exported at the same time, please keep one of them. Read more: https://nextjs.org/docs/app/api-reference/file-conventions/metadata\n\n`);
formattedVerboseMessage = "\n\nFile path:\n";
}
return [
formattedMessage,
formattedVerboseMessage
];
}
function getRscError(fileName, err, module, compilation, compiler) {
if (!err.message || !/NEXT_RSC_ERR_/.test(err.message)) {
return false;
}
const { isPagesDir, moduleTrace } = (0, _getModuleTrace.getModuleTrace)(module, compilation, compiler);
const formattedError = formatRSCErrorMessage(err.message, isPagesDir, fileName);
const { formattedModuleTrace, lastInternalFileName, invalidImportMessage } = (0, _getModuleTrace.formatModuleTrace)(compiler, moduleTrace);
const error = new _simpleWebpackError.SimpleWebpackError(lastInternalFileName, "ReactServerComponentsError:\n" + formattedError[0] + invalidImportMessage + formattedError[1] + formattedModuleTrace);
// Delete the stack because it's created here.
error.stack = "";
return error;
}
//# sourceMappingURL=parseRSC.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/plugins/wellknown-errors-plugin/parseRSC.ts"],"names":["getRscError","formatRSCErrorMessage","message","isPagesDir","fileName","formattedMessage","formattedVerboseMessage","NEXT_RSC_ERR_REACT_API","NEXT_RSC_ERR_SERVER_IMPORT","NEXT_RSC_ERR_CLIENT_IMPORT","NEXT_RSC_ERR_CLIENT_METADATA_EXPORT","NEXT_RSC_ERR_CONFLICT_METADATA_EXPORT","NEXT_RSC_ERR_CLIENT_DIRECTIVE","NEXT_RSC_ERR_CLIENT_DIRECTIVE_PAREN","NEXT_RSC_ERR_INVALID_API","NEXT_RSC_ERR_ERROR_FILE_SERVER_COMPONENT","test","matches","match","replace","shouldAddUseClient","err","module","compilation","compiler","moduleTrace","getModuleTrace","formattedError","formattedModuleTrace","lastInternalFileName","invalidImportMessage","formatModuleTrace","error","SimpleWebpackError","stack"],"mappings":";;;;+BA2HgBA;;;eAAAA;;;gCAzHkC;oCACf;AAEnC,SAASC,sBACPC,OAAe,EACfC,UAAmB,EACnBC,QAAgB;IAEhB,IA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;IAE9B,MAAMO,QAAQ,IAAIC,sCAAkB,CAClCJ,sBACA,kCACEF,cAAc,CAAC,EAAE,GACjBG,uBACAH,cAAc,CAAC,EAAE,GACjBC;IAGJ,8CAA8C;IAC9CI,MAAME,KAAK,GAAG;IAEd,OAAOF;AACT"}

View File

@@ -0,0 +1,2 @@
import { SimpleWebpackError } from './simpleWebpackError';
export declare function getScssError(fileName: string, fileContent: string | null, err: Error): SimpleWebpackError | false;

View File

@@ -0,0 +1,50 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getScssError", {
enumerable: true,
get: function() {
return getScssError;
}
});
const _chalk = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/chalk"));
const _simpleWebpackError = require("./simpleWebpackError");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
const chalk = new _chalk.default.constructor({
enabled: true
});
const regexScssError = /SassError: (.+)\n\s+on line (\d+) [\s\S]*?>> (.+)\n\s*(-+)\^$/m;
function getScssError(fileName, fileContent, err) {
if (err.name !== "SassError") {
return false;
}
const res = regexScssError.exec(err.message);
if (res) {
const [, reason, _lineNumer, backupFrame, columnString] = res;
const lineNumber = Math.max(1, parseInt(_lineNumer, 10));
const column = (columnString == null ? void 0 : columnString.length) ?? 1;
let frame;
if (fileContent) {
try {
const { codeFrameColumns } = require("next/dist/compiled/babel/code-frame");
frame = codeFrameColumns(fileContent, {
start: {
line: lineNumber,
column
}
}, {
forceColor: true
});
} catch {}
}
return new _simpleWebpackError.SimpleWebpackError(`${chalk.cyan(fileName)}:${chalk.yellow(lineNumber.toString())}:${chalk.yellow(column.toString())}`, chalk.red.bold("Syntax error").concat(`: ${reason}\n\n${frame ?? backupFrame}`));
}
return false;
}
//# sourceMappingURL=parseScss.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/plugins/wellknown-errors-plugin/parseScss.ts"],"names":["getScssError","chalk","Chalk","constructor","enabled","regexScssError","fileName","fileContent","err","name","res","exec","message","reason","_lineNumer","backupFrame","columnString","lineNumber","Math","max","parseInt","column","length","frame","codeFrameColumns","require","start","line","forceColor","SimpleWebpackError","cyan","yellow","toString","red","bold","concat"],"mappings":";;;;+BAOgBA;;;eAAAA;;;8DAPE;oCACiB;;;;;;AAEnC,MAAMC,QAAQ,IAAIC,cAAK,CAACC,WAAW,CAAC;IAAEC,SAAS;AAAK;AACpD,MAAMC,iBACJ;AAEK,SAASL,aACdM,QAAgB,EAChBC,WAA0B,EAC1BC,GAAU;IAEV,IAAIA,IAAIC,IAAI,KAAK,aAAa;QAC5B,OAAO;IACT;IAEA,MAAMC,MAAML,eAAeM,IAAI,CAACH,IAAII,OAAO;IAC3C,IAAIF,KAAK;QACP,MAAM,GAAGG,QAAQC,YAAYC,aAAaC,aAAa,GAAGN;QAC1D,MAAMO,aAAaC,KAAKC,GAAG,CAAC,GAAGC,SAASN,YAAY;QACpD,MAAMO,SAASL,CAAAA,gCAAAA,aAAcM,MAAM,KAAI;QAEvC,IAAIC;QACJ,IAAIhB,aAAa;YACf,IAAI;gBACF,MAAM,EACJiB,gBAAgB,EACjB,GAAGC,QAAQ;gBACZF,QAAQC,iBACNjB,aACA;oBAAEmB,OAAO;wBAAEC,MAAMV;wBAAYI;oBAAO;gBAAE,GACtC;oBAAEO,YAAY;gBAAK;YAEvB,EAAE,OAAM,CAAC;QACX;QAEA,OAAO,IAAIC,sCAAkB,CAC3B,CAAC,EAAE5B,MAAM6B,IAAI,CAACxB,UAAU,CAAC,EAAEL,MAAM8B,MAAM,CACrCd,WAAWe,QAAQ,IACnB,CAAC,EAAE/B,MAAM8B,MAAM,CAACV,OAAOW,QAAQ,IAAI,CAAC,EACtC/B,MAAMgC,GAAG,CACNC,IAAI,CAAC,gBACLC,MAAM,CAAC,CAAC,EAAE,EAAEtB,OAAO,IAAI,EAAEU,SAASR,YAAY,CAAC;IAEtD;IAEA,OAAO;AACT"}

View File

@@ -0,0 +1,7 @@
import type { webpack } from 'next/dist/compiled/webpack/webpack';
declare const SimpleWebpackError_base: typeof webpack.WebpackError;
export declare class SimpleWebpackError extends SimpleWebpackError_base {
file: string;
constructor(file: string, message: string);
}
export {};

View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "SimpleWebpackError", {
enumerable: true,
get: function() {
return SimpleWebpackError;
}
});
class SimpleWebpackError extends Error {
constructor(file, message){
super(message);
this.file = file;
}
}
//# sourceMappingURL=simpleWebpackError.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/plugins/wellknown-errors-plugin/simpleWebpackError.ts"],"names":["SimpleWebpackError","Error","constructor","file","message"],"mappings":";;;;+BAKaA;;;eAAAA;;;AAAN,MAAMA,2BAA4BC;IAGvCC,YAAYC,IAAY,EAAEC,OAAe,CAAE;QACzC,KAAK,CAACA;QACN,IAAI,CAACD,IAAI,GAAGA;IACd;AACF"}

View File

@@ -0,0 +1,3 @@
import type { webpack } from 'next/dist/compiled/webpack/webpack';
import { SimpleWebpackError } from './simpleWebpackError';
export declare function getModuleBuildError(compiler: webpack.Compiler, compilation: webpack.Compilation, input: any): Promise<SimpleWebpackError | false>;

View File

@@ -0,0 +1,141 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "getModuleBuildError", {
enumerable: true,
get: function() {
return getModuleBuildError;
}
});
const _fs = require("fs");
const _path = /*#__PURE__*/ _interop_require_wildcard(require("path"));
const _parseBabel = require("./parseBabel");
const _parseCss = require("./parseCss");
const _parseScss = require("./parseScss");
const _parseNotFoundError = require("./parseNotFoundError");
const _iserror = /*#__PURE__*/ _interop_require_default(require("../../../../lib/is-error"));
const _parseRSC = require("./parseRSC");
const _parseNextFontError = require("./parseNextFontError");
const _parseNextAppLoaderError = require("./parseNextAppLoaderError");
const _parseNextInvalidImportError = require("./parseNextInvalidImportError");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
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 = {};
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;
}
function getFileData(compilation, m) {
var _compilation_compiler;
let resolved;
let ctx = ((_compilation_compiler = compilation.compiler) == null ? void 0 : _compilation_compiler.context) ?? null;
if (ctx !== null && typeof m.resource === "string") {
const res = _path.relative(ctx, m.resource).replace(/\\/g, _path.posix.sep);
resolved = res.startsWith(".") ? res : `.${_path.posix.sep}${res}`;
} else {
const requestShortener = compilation.requestShortener;
if (typeof (m == null ? void 0 : m.readableIdentifier) === "function") {
resolved = m.readableIdentifier(requestShortener);
} else {
resolved = m.request ?? m.userRequest;
}
}
if (resolved) {
let content = null;
try {
content = (0, _fs.readFileSync)(ctx ? _path.resolve(ctx, resolved) : resolved, "utf8");
} catch {}
return [
resolved,
content
];
}
return [
"<unknown>",
null
];
}
async function getModuleBuildError(compiler, compilation, input) {
if (!(typeof input === "object" && ((input == null ? void 0 : input.name) === "ModuleBuildError" || (input == null ? void 0 : input.name) === "ModuleNotFoundError") && Boolean(input.module) && (0, _iserror.default)(input.error))) {
return false;
}
const err = input.error;
const [sourceFilename, sourceContent] = getFileData(compilation, input.module);
const notFoundError = await (0, _parseNotFoundError.getNotFoundError)(compilation, input, sourceFilename, input.module);
if (notFoundError !== false) {
return notFoundError;
}
const imageError = await (0, _parseNotFoundError.getImageError)(compilation, input, err);
if (imageError !== false) {
return imageError;
}
const babel = (0, _parseBabel.getBabelError)(sourceFilename, err);
if (babel !== false) {
return babel;
}
const css = (0, _parseCss.getCssError)(sourceFilename, err);
if (css !== false) {
return css;
}
const scss = (0, _parseScss.getScssError)(sourceFilename, sourceContent, err);
if (scss !== false) {
return scss;
}
const rsc = (0, _parseRSC.getRscError)(sourceFilename, err, input.module, compilation, compiler);
if (rsc !== false) {
return rsc;
}
const nextFont = (0, _parseNextFontError.getNextFontError)(err, input.module);
if (nextFont !== false) {
return nextFont;
}
const nextAppLoader = (0, _parseNextAppLoaderError.getNextAppLoaderError)(err, input.module, compiler);
if (nextAppLoader !== false) {
return nextAppLoader;
}
const invalidImportError = (0, _parseNextInvalidImportError.getNextInvalidImportError)(err, input.module, compilation, compiler);
if (invalidImportError !== false) {
return invalidImportError;
}
return false;
}
//# sourceMappingURL=webpackModuleError.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/plugins/wellknown-errors-plugin/webpackModuleError.ts"],"names":["getModuleBuildError","getFileData","compilation","m","resolved","ctx","compiler","context","resource","res","path","relative","replace","posix","sep","startsWith","requestShortener","readableIdentifier","request","userRequest","content","readFileSync","resolve","input","name","Boolean","module","isError","error","err","sourceFilename","sourceContent","notFoundError","getNotFoundError","imageError","getImageError","babel","getBabelError","css","getCssError","scss","getScssError","rsc","getRscError","nextFont","getNextFontError","nextAppLoader","getNextAppLoaderError","invalidImportError","getNextInvalidImportError"],"mappings":";;;;+BA+CsBA;;;eAAAA;;;oBA/CO;8DACP;4BAGQ;0BACF;2BACC;oCACmB;gEAE5B;0BACQ;oCACK;yCACK;6CACI;;;;;;;;;;;;;;;;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