Skip to content

Dependencies

Code imports a package that is not in package.jsondeps.undeclared-import

The code imports a package that no package.json lists. Either the name was made up (AI assistants invent plausible package names, and attackers register them), or it only works because another package happened to install it. A clean install, a different package manager or the next dependency update breaks the build in production.

  • In force Rule deps.undeclared-import
  • 3 clauses

At a glance

deps.undeclared-import
Severitymedium
CertaintyObserved — the code as written is the problem
Looks atyour source code
When it runsRuns on every scan

How to fix it

If it is the package you meant, add it explicitly (`npm install <name>`) so the version is pinned in package.json and the lockfile. If you cannot find it on npmjs.com from its official docs, it was invented: replace the import with the real library.

Check your own app

Run npx scanlyfix scan in your project. Every finding gets an id; after fixing, npx scanlyfix verify <id> proves it is gone.

If it is a false positive in your project, silence that one line with // scanlyfix-ignore-next-line deps.undeclared-import -- <why>.

All rules

Your code stays
on your machine

Only findings are uploaded, and only to your own dashboard.