oxc-project/oxc · error · OxcDiagnostic
{specifier_name:?} not found in imported namespace {namespac
Error message
{specifier_name:?} not found in imported namespace {namespace_name:?}. What it means
Fires from import/namespace when a property access on an imported namespace object (e.g. ns.foo) references a name the source module does not export. The no_export helper builds the message with the specifier and namespace names; it is reached from direct member accesses and from destructuring object patterns.
Source
Thrown at crates/oxc_linter/src/rules/import/namespace.rs:21
use oxc_ast::{
AstKind,
ast::{BindingPattern, ObjectPattern},
};
use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_semantic::AstNode;
use oxc_span::{GetSpan, Span};
use schemars::JsonSchema;
use serde::Deserialize;
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!(View on GitHub (pinned to e1e7af627c)
Solutions
- Correct the property name to one the source module exports
- Add the export to the source module
- Destructure only names that actually exist in the namespace
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/oxc_linter/src/rules/import/namespace.rs:21 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/1762be1d95938bd5.
Report an issue: GitHub.