slint-ui/slint · error · Error
slint-ui-dev must not be imported directly — it only…
Error message
slint-ui-dev must not be imported directly — it only provides the development binary for slint-ui. Import from "slint-ui" instead; having slint-ui-dev installed as a devDependency is enough to enable the development binary.
What it means
The slint-ui-dev package is a support package that only ships the development native binary for slint-ui; importing it directly is intentionally blocked with this Error. slint-ui loads the binary via the slint-ui-dev/loader subpath at runtime.
Solutions
- Import from 'slint-ui' instead: const slint = require('slint-ui').
- Keep slint-ui-dev only as a devDependency; do not reference it in application code.
- Remove accidental slint-ui-dev imports from bundled source.
Example fix
// before
const slint = require('slint-ui-dev');
// after
const slint = require('slint-ui'); Defensive patterns
Strategy: type-guard
Type guard
function importsDevPackageDirectly(specifier: string): boolean {
return specifier === 'slint-ui-dev' || specifier.startsWith('slint-ui-dev/');
} Prevention
- Always import the public entry point 'slint-ui'.
- Add an ESLint no-restricted-imports rule banning 'slint-ui-dev'.
- Keep slint-ui-dev listed only in devDependencies.
When it happens
Trigger: Requiring/importing 'slint-ui-dev' (require('slint-ui-dev') or import) instead of 'slint-ui'.
Common situations: Autocomplete picking the wrong package in an import statement, misunderstanding the dev-package's role when installing it as a devDependency to get the debug binary.
Understand the failure class
Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.
Related errors
- failed ( )
- Could not create a component handle for
- create
- Duplicated callback name
- Duplicated function name
AI-assisted analysis of slint-ui/slint@bb937076de (2026-09-16).
Data as JSON: /api/errors/e414c405b6018da9.
Report an issue: GitHub.
Appendix: source
Thrown at api/node/dev-package/index.cjs:11
// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
// slint-ui-dev only provides the development native binary for slint-ui; it is
// not meant to be imported directly. The actual binary is exposed via the
// "slint-ui-dev/loader" subpath, which slint-ui loads internally. Importing this
// package directly is almost always a mistake, so fail loudly with a hint.
"use strict";
throw new Error(
"slint-ui-dev must not be imported directly — it only provides the " +
'development binary for slint-ui. Import from "slint-ui" instead; having ' +
"slint-ui-dev installed as a devDependency is enough to enable the " +
"development binary.",
);
View on GitHub (pinned to bb937076de)