{"record":{"id":"c680a7eb7fdc1f9c","repo":"oxc-project/oxc","slug":"unable-to-validate-computed-reference-to-imported","errorCode":null,"errorMessage":"Unable to validate computed reference to imported namespace {namespace_name:?}.","messagePattern":"Unable to validate computed reference to imported namespace (.+?)\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/import/namespace.rs","lineNumber":39,"sourceCode":"    OxcDiagnostic::warn(format!(\n        \"{specifier_name:?} not found in imported namespace {namespace_name:?}.\"\n    ))\n    .with_label(span)\n}\n\nfn no_export_in_deeply_imported_namespace(\n    span: Span,\n    specifier_name: &str,\n    namespace_name: &str,\n) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\n        \"{specifier_name:?} not found in deeply imported namespace {namespace_name:?}.\"\n    ))\n    .with_label(span)\n}\n\nfn computed_reference(span: Span, namespace_name: &str) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\n        \"Unable to validate computed reference to imported namespace {namespace_name:?}.\"\n    ))\n    .with_help(\"Use a static property access (e.g. `namespace.name`) instead of a computed one.\")\n    .with_label(span)\n}\n\nfn assignment(span: Span, namespace_name: &str) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"Assignment to member of namespace {namespace_name:?}.'\"))\n        .with_help(\"Imported namespace members are read-only. Assign to a local variable instead.\")\n        .with_label(span)\n}\n\n// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/namespace.md>\n#[derive(Debug, Default, Clone, JsonSchema, Deserialize)]\n#[serde(rename_all = \"camelCase\", default, deny_unknown_fields)]\npub struct Namespace {\n    /// Whether to allow computed references to an imported namespace.\n    allow_computed: bool,","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/import/namespace.rs#L21-L57","documentation":"Fires from import/namespace when a namespace object is accessed with a computed member expression (ns[key]). Because the key is not a static string, the rule cannot resolve it against the module's export record, so it reports that validation is impossible and recommends a static property access.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/import/namespace.rs:39 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a static property access like `namespace.name` instead of a computed one","Use a type assertion or eslint-disable comment if dynamic access is required"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}