{"record":{"id":"307b53ce720912c3","repo":"zellij-org/zellij","slug":"module-referenced-at-is-not-part-of-the-bu","errorCode":null,"errorMessage":"module '{}' referenced at {} is not part of the bundle","messagePattern":"module '(.+?)' referenced at (.+?) is not part of the bundle","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/assets.rs","lineNumber":248,"sourceCode":"        .map(|(_, specifier)| specifier)\n        .ok_or_else(|| anyhow!(\"missing module specifier at {}\", location))?\n        .trim()\n        .trim_end_matches(';')\n        .trim_matches(|c| c == '\"' || c == '\\'');\n\n    let name = specifier\n        .strip_prefix(\"./\")\n        .and_then(|name| name.strip_suffix(\".js\"))\n        .ok_or_else(|| {\n            anyhow!(\n                \"only relative sibling module specifiers are supported, found '{}' at {}\",\n                specifier,\n                location\n            )\n        })?;\n\n    if !MODULE_ORDER.contains(&name) {\n        return Err(anyhow!(\n            \"module '{}' referenced at {} is not part of the bundle\",\n            name,\n            location\n        ));\n    }\n    Ok(())\n}\n\nfn top_level_declarations(chunk: &str) -> Vec<String> {\n    let mut names = Vec::new();\n    for line in chunk.lines() {\n        if line.starts_with(char::is_whitespace) {\n            continue;\n        }\n        for prefix in DECLARATION_PREFIXES {\n            let Some(rest) = line.strip_prefix(prefix) else {\n                continue;\n            };","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/zellij-org/zellij/blob/98a0837077492d53dd252ab30bc3e43e41e504f4/xtask/src/assets.rs#L230-L266","documentation":"The specifier parsed to `./name.js`, but `name` is not listed in MODULE_ORDER (xtask/src/assets.rs), so the bundle would reference code that is never concatenated. Only imports targeting one of the registered sibling modules are allowed.","triggerScenarios":"Creating a new file helpers.js in zellij-client/assets and importing it as './helpers.js' without adding 'helpers' to MODULE_ORDER; renaming a module file without updating MODULE_ORDER.","commonSituations":"Adding a new frontend module during feature work; refactors that rename module files; scratch files accidentally imported.","solutions":["Add the module name to MODULE_ORDER in xtask/src/assets.rs — order matters, dependencies must come before importers","Or import the functionality from an existing bundled module instead of creating a new file","If you renamed a module, update both the file's importers and MODULE_ORDER in the same change"],"exampleFix":"// before: xtask/src/assets.rs\nconst MODULE_ORDER: &[&str] = &[\"utils\", /* ... */];\n// importing './helpers.js' fails\n\n// after\nconst MODULE_ORDER: &[&str] = &[\"utils\", \"helpers\", /* ... */];","handlingStrategy":"validation","validationCode":"# every ./x.js specifier must match a name in MODULE_ORDER\nMODULES=\"utils connection auth keyboard links terminal ime-bypass soft-keyboard key-handler mouse pinch mobile-pan touch input mobile-ui websockets index\"\nfor spec in $(grep -hoE \"from ['\\\"]\\./[^'\\\"]+\\.js['\\\"]\" zellij-client/assets/*.js | sed -E \"s/from ['\\\"]\\.\\/([^'\\\"]+)\\.js['\\\"]/\\1/\" | sort -u); do\n  echo \" $MODULES \" | grep -q \" $spec \" || { echo \"module '$spec' not in MODULE_ORDER\"; exit 1; }\ndone","typeGuard":"const MODULE_ORDER: &[&str] = &[/* same list as xtask/src/assets.rs */];\n\nfn module_is_bundled(specifier: &str) -> bool {\n    specifier\n        .strip_prefix(\"./\")\n        .and_then(|s| s.strip_suffix(\".js\"))\n        .is_some_and(|name| MODULE_ORDER.contains(&name))\n}","tryCatchPattern":null,"preventionTips":["When adding a module file, register it in MODULE_ORDER in the same commit (dependencies before importers)","When renaming a module, update importers and MODULE_ORDER together","The pre-flight loop above catches this before the slower full bundling run"],"tags":["javascript","bundler","configuration","assets"],"backgroundTag":null,"analyzedSha":"98a0837077492d53dd252ab30bc3e43e41e504f4","analyzedAt":"2026-08-16T13:02:01.396Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}