7}
8
9export const isError = (input: unknown): input is RestError =>
10 !!input && typeof input === "object" && "error" in input;
11
6729 __name(makeResponse, "makeResponse");
6730 function makeNetworkError(reason) {
6731 const isError = isErrorLike(reason);
6732 return makeResponse({
6733 type: "error",
479 }
480 __name(isDate, "isDate");
481 function isError(value) {
482 return kind(value, "object") && (Object.prototype.toString.call(value) === "[object Error]" || value instanceof Error);
483 }
105 | {
106 output: string | null
107 isError: boolean
108 eventInfo: EventLintCheckCompleted
109 }
9}
10
11export default function isError(err: unknown): err is NextError {
12 return (
13 typeof err === 'object' && err !== null && 'name' in err && 'message' in err
254 onRecoverableError,
255 }
256 const isError = document.documentElement.id === '__next_error__'
257
258 if (process.env.NODE_ENV !== 'production') {
562 }
563 __name(isDisturbed, "isDisturbed");
564 function isErrored(body) {
565 return !!(body && (stream.isErrored ? stream.isErrored(body) : /state: 'errored'/.test(
566 nodeUtil.inspect(body)
43
44function formatConfigErrorMessage(err: ZodError) {
45 const errorList = err.issues.map((issue) => ` ${issue.path.join('.')} ${issue.message + '.'}`);
46 return errorList.join('\n');
47}
190
191export function formatConfigErrorMessage(err: ZodError) {
192 const errorList = err.issues.map(
193 (issue) => ` ! ${bold(issue.path.join('.'))} ${red(issue.message + '.')}`
194 );
199
200export function formatErrorMessage(err: ErrorWithMetadata, args: string[] = []): string {
201 const isOurError = AstroError.is(err) || CompilerError.is(err);
202
203 args.push(
1993 } catch (error) {
1994 const renderToHtmlError = getProperError(error)
1995 const isWrappedError = renderToHtmlError instanceof WrappedBuildError
1996 if (!isWrappedError) {
1997 this.logError(renderToHtmlError)
1797 }
1798
1799 const isWrappedError = err instanceof WrappedBuildError
1800
1801 if (!isWrappedError) {
871 }
872 __name(requestBadPort, "requestBadPort");
873 function isErrorLike(object) {
874 var _a, _b;
875 return object instanceof Error || (((_a = object == null ? void 0 : object.constructor) == null ? void 0 : _a.name) === "Error" || ((_b = object == null ? void 0 : object.constructor) == null ? void 0 : _b.name) === "DOMException");
11import {
12 getClientBuildManifest,
13 isAssetError,
14 markAssetError,
15} from '../../../client/route-loader'
144 const { page } = pathMap
145 const isAppDir = (pathMap as any)._isAppDir
146 const isDynamicError = (pathMap as any)._isDynamicError
147 const filePath = normalizePagePath(path)
148 const isDynamic = isDynamicRoute(page)
248 }
249
250 const isServerError = ['server', 'edge-server'].includes(
251 getErrorSource(activeError.error) || ''
252 )
20}
21
22function isHydrationError(error: Error): boolean {
23 return (
24 error.message.match(/(hydration|content does not match|did not match)/i) !=
20 const origConsoleError = window.console.error
21 window.console.error = (...args) => {
22 const isHydrateError = args.some(
23 (arg) =>
24 typeof arg === 'string' &&
87}
88
89export function isAssetError(err?: Error): boolean | undefined {
90 return err && ASSET_LOAD_ERROR in err
91}
246 }
247
248 const isServerError = ['server', 'edge-server'].includes(
249 getErrorSource(activeError.error) || ''
250 )
317 const isServerError = frame.isServer === 'true'
318 const isEdgeServerError = frame.isEdgeServer === 'true'
319 const isClientError = !isServerError && !isEdgeServerError
320
321 if (
315 }
316 const isAppDirectory = frame.isAppDirectory === 'true'
317 const isServerError = frame.isServer === 'true'
318 const isEdgeServerError = frame.isEdgeServer === 'true'
319 const isClientError = !isServerError && !isEdgeServerError
174 }
175 } catch (reason) {
176 function isErrorLike(err: unknown): err is { message: string } {
177 return (
178 typeof err === 'object' &&
1698 return await this.renderToResponseWithComponents(ctx, result)
1699 } catch (err) {
1700 const isNoFallbackError = err instanceof NoFallbackError
1701
1702 if (!isNoFallbackError || (isNoFallbackError && bubbleNoFallback)) {
1804}
1805
1806export function isCustomErrorPage(page: string) {
1807 return page === '/404' || page === '/500'
1808}
11}
12
13function isNextRouterError(error: any): boolean {
14 return (
15 error &&
316 const isAppDirectory = frame.isAppDirectory === 'true'
317 const isServerError = frame.isServer === 'true'
318 const isEdgeServerError = frame.isEdgeServer === 'true'
319 const isClientError = !isServerError && !isEdgeServerError
320
6import { getPkgManager } from '../helpers/get-pkg-manager'
7
8export async function missingDepsError(
9 dir: string,
10 missingPackages: MissingDependency[]
17import { installDependencies } from './install-dependencies'
18import { isCI } from '../telemetry/ci-info'
19import { missingDepsError } from './typescript/missingDependencyError'
20import { writeVscodeConfigurations } from './typescript/writeVscodeConfigurations'
21
13import { getPkgManager } from './helpers/get-pkg-manager'
14
15async function missingDependencyError(dir: string) {
16 const packageManager = getPkgManager(dir)
17
5 onOfflineReady?: () => void;
6 onRegistered?: (registration: ServiceWorkerRegistration | undefined) => void;
7 onRegisterError?: (error: any) => void;
8 };
9
117 // When attempting this on a React component, React may output
118 // the following error, which we can safely filter out:
119 const isKnownReactHookError =
120 msg.includes('Warning: Invalid hook call.') &&
121 msg.includes('https://reactjs.org/link/invalid-hook-call');
272 // When attempting this on a React component, React may output
273 // the following error, which we can safely filter out:
274 const isKnownReactHookError =
275 msg.includes('Warning: Invalid hook call.') &&
276 msg.includes('https://reactjs.org/link/invalid-hook-call');
1export function isDuplicateKeyValueError(e: unknown | Error): boolean {
2 return (e as any).message && (e as Error).message.startsWith('duplicate key value');
3}
11import type { UserCacheService } from '@/core/UserCacheService.js';
12import { normalizeForSearch } from '@/misc/normalize-for-search.js';
13import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js';
14import type Logger from '@/logger.js';
15import type { Note } from '@/models/entities/Note.js';
6import { GlobalEventService } from '@/core/GlobalEventService.js';
7import { IdService } from '@/core/IdService.js';
8import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js';
9import type { Packed } from '@/misc/schema.js';
10import InstanceChart from '@/core/chart/charts/instance.js';
12import { DriveFile } from '@/models/entities/DriveFile.js';
13import { IdService } from '@/core/IdService.js';
14import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js';
15import { FILE_TYPE_BROWSERSAFE } from '@/const.js';
16import { IdentifiableError } from '@/misc/identifiable-error.js';
8import { IdService } from '@/core/IdService.js';
9import type { NoteReaction } from '@/models/entities/NoteReaction.js';
10import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js';
11import { GlobalEventService } from '@/core/GlobalEventService.js';
12import { CreateNotificationService } from '@/core/CreateNotificationService.js';
15import type { IPoll } from '@/models/entities/Poll.js';
16import { Poll } from '@/models/entities/Poll.js';
17import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js';
18import { checkWordMute } from '@/misc/check-word-mute.js';
19import type { Channel } from '@/models/entities/Channel.js';
184export default function formatWebpackMessages(json: any, verbose?: boolean) {
185 const formattedErrors = json.errors.map((message: any) => {
186 const isUnknownNextFontError = message.message.includes(
187 'An error occured in `@next/font`.'
188 )
31 '\n\nBREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.'
32
33function isLikelyASyntaxError(message: string) {
34 return stripAnsi(message).indexOf(friendlySyntaxErrorLabel) !== -1
35}
6const reactTypeof = Symbol.for('react.element');
7
8function errorIsComingFromPreactComponent(err) {
9 return (
10 err.message &&
6const reactTypeof = Symbol.for('react.element');
7
8function errorIsComingFromPreactComponent(err) {
9 return (
10 err.message &&
35}
36
37let hadMissingSassError = false
38
39// Cleans up webpack error messages.
288 };
289 __name(NotSupportedError, "NotSupportedError");
290 var BalancedPoolMissingUpstreamError = class extends UndiciError {
291 constructor(message) {
292 super(message);
48 buildError: string | null
49 errors: SupportedErrorEvent[]
50 rootLayoutMissingTagsError?: {
51 missingTags: string[]
52 }
52 const hasBuildError = state.buildError != null
53 const hasRuntimeErrors = Boolean(state.errors.length)
54 const rootLayoutMissingTagsError = state.rootLayoutMissingTagsError
55 const isMounted =
56 hasBuildError ||
198export function hydrate() {
199 if (process.env.NODE_ENV !== 'production') {
200 const rootLayoutMissingTagsError = (self as any)
201 .__next_root_layout_missing_tags_error
202 const HotReload: typeof import('./components/react-dev-overlay/hot-reloader-client').default =
237 };
238 __name(RequestContentLengthMismatchError, "RequestContentLengthMismatchError");
239 var ResponseContentLengthMismatchError = class extends UndiciError {
240 constructor(message) {
241 super(message);
227 };
228 __name(InformationalError, "InformationalError");
229 var RequestContentLengthMismatchError = class extends UndiciError {
230 constructor(message) {
231 super(message);