{"record":{"id":"b73869274ceed8c6","repo":"zellij-org/zellij","slug":"unterminated-import-statement-at","errorCode":null,"errorMessage":"unterminated import statement at {}","messagePattern":"unterminated import statement at (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/assets.rs","lineNumber":178,"sourceCode":"        if let Some(rest) = line.strip_prefix(\"import \") {\n            if is_terminated_import(rest) {\n                validate_module_specifier(rest, &location())?;\n                continue;\n            }\n            let mut terminated = false;\n            for (_, continuation) in lines.by_ref() {\n                let trimmed = continuation.trim_start();\n                if trimmed.starts_with(\"} from \") && trimmed.ends_with(';') {\n                    validate_module_specifier(trimmed, &location())?;\n                    terminated = true;\n                    break;\n                }\n                if !is_import_binding_line(trimmed) {\n                    return Err(anyhow!(\"unrecognised import syntax at {}\", location()));\n                }\n            }\n            if !terminated {\n                return Err(anyhow!(\"unterminated import statement at {}\", location()));\n            }\n            continue;\n        }\n\n        if line.starts_with(\"export \") || line.starts_with(\"export{\") {\n            if line.starts_with(\"export {\") {\n                if line.contains(\" from \") {\n                    validate_module_specifier(line, &location())?;\n                    continue;\n                }\n                return Err(anyhow!(\"unrecognised export syntax at {}\", location()));\n            }\n            if line.starts_with(\"export default\") || line.starts_with(\"export *\") {\n                return Err(anyhow!(\"unsupported export form at {}\", location()));\n            }\n            let stripped = &line[\"export \".len()..];\n            if !DECLARATION_PREFIXES\n                .iter()","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/zellij-org/zellij/blob/98a0837077492d53dd252ab30bc3e43e41e504f4/xtask/src/assets.rs#L160-L196","documentation":"A multi-line import statement never found its closing `} from './x.js';` line: the parser consumed every remaining line of the file as import bindings and hit end-of-file with `terminated` still false, so bundling aborts.","triggerScenarios":"Deleting or truncating the `} from ...;` line when editing an import block; a pasted import that got cut off mid-block.","commonSituations":"Merge conflicts resolved badly inside import blocks; partial pastes; editor auto-removing a line while refactoring imports.","solutions":["Restore the closing `} from './name.js';` line of the import block","Collapse the import to one line so the structure is obvious and cannot dangle","Check the file named in the error (module.js:line points at the opening `import` line) for conflict markers or truncation"],"exampleFix":"// before (file ends without a from-clause)\nimport {\n  a,\n  b,\n\n// after\nimport {\n  a,\n  b,\n} from './utils.js';","handlingStrategy":"validation","validationCode":"# every 'import {' block must be closed by a '} from \"./x.js\";' line\npython3 - <<'EOF'\nimport pathlib, re\nfor p in pathlib.Path('zellij-client/assets').glob('*.js'):\n    open_import = False\n    for n, line in enumerate(p.read_text().splitlines(), 1):\n        if re.match(r'^import .*[^;]$', line): open_import = True\n        elif open_import and line.rstrip().endswith(';'): open_import = False\n    if open_import: print(f'{p}:{n}: unterminated import block')\nEOF","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Complete import blocks before saving; let the editor's bracket matching confirm closure","Avoid splitting imports across merge-conflict regions","Run `cargo xtask assets` after rebases touching the web client"],"tags":["javascript","bundler","parser","import","assets"],"backgroundTag":null,"analyzedSha":"98a0837077492d53dd252ab30bc3e43e41e504f4","analyzedAt":"2026-08-16T13:02:01.396Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}