← Files RivetARCHIVED FILE
node_modules/rivet-design/dist/utils/devServerError.js
1.64 KB · Nov 7, 2026 · 13:16 UTC
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DevServerStartError = exports.isCompilationFailureOutput = void 0;
exports.isPortInUseOutput = isPortInUseOutput;
exports.isMissingDependencyOutput = isMissingDependencyOutput;
exports.isDevServerStartError = isDevServerStartError;
const COMPILATION_FAILURE_PATTERN = /Failed to compile|Module parse failed|TurbopackInternalError|Error evaluating Node\.js code|Transform failed with \d+ errors?/i;
const isCompilationFailureOutput = (output) => COMPILATION_FAILURE_PATTERN.test(output);
exports.isCompilationFailureOutput = isCompilationFailureOutput;
const PORT_IN_USE_RE = /EADDRINUSE|address already in use|already running|already in use/i;
function isPortInUseOutput(output) {
return PORT_IN_USE_RE.test(output);
}
const MISSING_DEPENDENCY_RE = /Cannot find module|Cannot find package|ERR_MODULE_NOT_FOUND|MODULE_NOT_FOUND|command not found|(?:sh|bash|zsh)(?::| -c:)? (?:line \d+: )?[^\n]*: not found/i;
function isMissingDependencyOutput(output) {
return MISSING_DEPENDENCY_RE.test(output);
}
class DevServerStartError extends Error {
reason;
portInUse;
detail;
exitCode;
signal;
constructor(opts) {
super(opts.message);
this.name = 'DevServerStartError';
this.reason = opts.reason;
this.portInUse = opts.portInUse;
this.detail = opts.detail;
this.exitCode = opts.exitCode ?? null;
this.signal = opts.signal ?? null;
}
}
exports.DevServerStartError = DevServerStartError;
function isDevServerStartError(err) {
return err instanceof DevServerStartError;
}
//# sourceMappingURL=devServerError.js.mapSHA-256: 93970c44677ea86b1c16648dd858399a0cc7d5a0ddc426018ae4d4d4a5e4484d