{"record":{"id":"9f853694fd30aaf0","repo":"zellij-org/zellij","slug":"unrecognised-export-syntax-at","errorCode":null,"errorMessage":"unrecognised export syntax at {}","messagePattern":"unrecognised export syntax at (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/assets.rs","lineNumber":189,"sourceCode":"                    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()\n                .any(|prefix| stripped.starts_with(prefix))\n            {\n                return Err(anyhow!(\"unrecognised export syntax at {}\", location()));\n            }\n            out.push_str(stripped);\n            out.push('\\n');\n            continue;\n        }\n\n        out.push_str(line);\n        out.push('\\n');","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/zellij-org/zellij/blob/98a0837077492d53dd252ab30bc3e43e41e504f4/xtask/src/assets.rs#L171-L207","documentation":"`export {` without a `from` clause (a bottom-of-file list re-exporting local bindings) is rejected. The flattener only supports two export forms: re-exports `export { x } from './mod.js';` (dropped, since imports vanish) and `export <declaration>` (keyword stripped).","triggerScenarios":"Ending a module with `export { doThing };` to expose an already-declared function instead of marking the declaration itself as exported.","commonSituations":"Refactoring a module from per-function `export function` declarations to a CommonJS-style bottom export list; copying Node-style module patterns into the web client.","solutions":["Move the export keyword onto the declaration: `export function doThing() {...}`","If the intent is re-exporting another module's binding, add the from clause: `export { doThing } from './utils.js';`"],"exampleFix":"// before (rejected)\nfunction doThing() {}\nexport { doThing };\n\n// after\nexport function doThing() {}","handlingStrategy":"validation","validationCode":"# bottom-of-file export lists without 'from' are unsupported\ngrep -nE '^export \\{[^}]*\\};?[[:space:]]*$' zellij-client/assets/*.js && { echo 'use export on the declaration itself'; exit 1; } || true","typeGuard":"fn is_bare_export_list(line: &str) -> bool {\n    line.starts_with(\"export {\") && !line.contains(\" from \")\n}","tryCatchPattern":null,"preventionTips":["Always export at the declaration site (`export function ...`), never via a trailing list","Reserve `export { x } from './mod.js';` strictly for re-exports that include the from clause"],"tags":["javascript","bundler","export","assets"],"backgroundTag":null,"analyzedSha":"98a0837077492d53dd252ab30bc3e43e41e504f4","analyzedAt":"2026-08-16T13:02:01.396Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}