oxc-project/oxc · error · OxcDiagnostic

{specifier_name:?} not found in deeply imported namespace {n

Error message

{specifier_name:?} not found in deeply imported namespace {namespace_name:?}.

What it means

Fires from import/namespace (with deep checking) when a property is accessed through a chained/intermediate namespace re-export (e.g. ns.inner.foo) and the name is absent from that inner namespace's exports. Emitted by no_export_in_deeply_imported_namespace during deep namespace traversal of nodes and object patterns.

Source

Thrown at crates/oxc_linter/src/rules/import/namespace.rs:32

use crate::{
    context::LintContext,
    module_record::{ExportExportName, ExportImportName, ImportImportName, ModuleRecord},
    rule::{DefaultRuleConfig, Rule},
};

fn no_export(span: Span, specifier_name: &str, namespace_name: &str) -> OxcDiagnostic {
    OxcDiagnostic::warn(format!(
        "{specifier_name:?} not found in imported namespace {namespace_name:?}."
    ))
    .with_label(span)
}

fn no_export_in_deeply_imported_namespace(
    span: Span,
    specifier_name: &str,
    namespace_name: &str,
) -> OxcDiagnostic {
    OxcDiagnostic::warn(format!(
        "{specifier_name:?} not found in deeply imported namespace {namespace_name:?}."
    ))
    .with_label(span)
}

fn computed_reference(span: Span, namespace_name: &str) -> OxcDiagnostic {
    OxcDiagnostic::warn(format!(
        "Unable to validate computed reference to imported namespace {namespace_name:?}."
    ))
    .with_help("Use a static property access (e.g. `namespace.name`) instead of a computed one.")
    .with_label(span)
}

fn assignment(span: Span, namespace_name: &str) -> OxcDiagnostic {
    OxcDiagnostic::warn(format!("Assignment to member of namespace {namespace_name:?}.'"))
        .with_help("Imported namespace members are read-only. Assign to a local variable instead.")
        .with_label(span)
}

View on GitHub (pinned to e1e7af627c)

Solutions

  1. Fix the name accessed on the nested namespace
  2. Add the missing export to the intermediate module
  3. Import the symbol directly from the module that defines it
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/oxc_linter/src/rules/import/namespace.rs:32 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of oxc-project/oxc@e1e7af627c (2026-08-20). Data as JSON: /api/errors/d3c68ecf45882194. Report an issue: GitHub.