Skip to content

fix(types): move @types/debug from devDependencies to dependencies#290

Open
YevheniiKotyrlo wants to merge 1 commit intonativewind:mainfrom
YevheniiKotyrlo:fix/move-types-debug-to-dependencies
Open

fix(types): move @types/debug from devDependencies to dependencies#290
YevheniiKotyrlo wants to merge 1 commit intonativewind:mainfrom
YevheniiKotyrlo:fix/move-types-debug-to-dependencies

Conversation

@YevheniiKotyrlo
Copy link

Summary

compiler.types.ts exports the Debugger type from "debug" in the public CompilerOptions.logger type:

// src/compiler/compiler.types.ts
import type { Debugger } from "debug";

export interface CompilerOptions {
  logger?: (message: string) => void | Debugger;
}

This type is re-exported from the ./compiler entry point and published in the .d.ts files under dist/typescript/. However, @types/debug is listed in devDependencies, so it's not installed for consumers. The debug package itself ships no type declarations.

Consumers with skipLibCheck: false get:

error TS7016: Could not find a declaration file for module 'debug'.

This affects all NativeWind users because nativewind/metro imports react-native-css/metro, which transitively imports the compiler module:

metro.config.ts
  → nativewind/metro
    → react-native-css/metro
      → react-native-css/compiler
        → compiler.types.d.ts: import type { Debugger } from "debug"

Fix

Move @types/debug from devDependencies to dependencies. debug is already a runtime dependency — its type declarations should follow.

Test plan

  • yarn typecheck — pass
  • yarn lint — pass
  • yarn build — pass (module + commonjs + typescript)
  • yarn test — 969 passed, 3 pre-existing failures in babel plugin tests (unrelated)
  • No unstaged files after build
  • Verified in isolated consumer project: error reproduces without @types/debug, resolves with it installed

@YevheniiKotyrlo YevheniiKotyrlo force-pushed the fix/move-types-debug-to-dependencies branch from 3153651 to 6683bdb Compare March 4, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant