moeru-ai/airi · info

import @proj-airi/plugin-protocol/types instead

Error message

import @proj-airi/plugin-protocol/types instead

What it means

The root entrypoint of @proj-airi/plugin-protocol is intentionally export-free; its entire module body is this console.warn directing you to the typed subpath. Importing the package root does not fail the build — it just pulls in a module that prints the warning and provides nothing.

Source

Thrown at packages/plugin-protocol/src/index.ts:1

console.warn('import @proj-airi/plugin-protocol/types instead')

View on GitHub (pinned to 677329427f)

Solutions

  1. Change the import specifier to '@proj-airi/plugin-protocol/types'
  2. Add an ESLint import restriction (import/no-restricted-imports) forbidding the bare package name so it fails lint instead of warning at runtime

Example fix

// before
import type { PluginProtocol } from '@proj-airi/plugin-protocol'

// after
import type { PluginProtocol } from '@proj-airi/plugin-protocol/types'
Defensive patterns

Strategy: validation

Validate before calling

// before resolving, assert the subpath you meant to use
if (!specifier.startsWith('@proj-airi/plugin-protocol/')) {
  throw new Error('import @proj-airi/plugin-protocol/types instead')
}

Prevention

When it happens

Trigger: Any `import ... from '@proj-airi/plugin-protocol'` (root specifier) instead of '@proj-airi/plugin-protocol/types'.

Common situations: IDE auto-complete inserting the root specifier; code migrated from an older layout where the root was the API; barrel-file tooling resolving to the root.

Related errors


AI-assisted analysis of moeru-ai/airi@677329427f (2026-08-18). Data as JSON: /api/errors/8b37eeb47ab38c23. Report an issue: GitHub.