Skip to content

isMissingSveltePackageError

Checks whether an error is the one loading esbuild-svelte throws when the svelte package is not installed.

esbuild-svelte imports svelte/compiler when it loads, and package managers that do not install peers (Yarn 1) leave svelte out of a project that has no Svelte components.

Import:

import { isMissingSveltePackageError } from '@mnaoumov/typescript-dev-toolkit/bundlers/esbuild-impl/svelte-wrapper-plugin';

Signature:

function isMissingSveltePackageError(error: unknown): boolean

Parameters:

Parameter Type Description
error unknown The error to check.

Returns: boolean — Whether the error says that the svelte package cannot be found.