{"record":{"id":"ffe87b089601572b","repo":"zellij-org/zellij","slug":"unsupported-export-form-at","errorCode":null,"errorMessage":"unsupported export form at {}","messagePattern":"unsupported export form at (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/assets.rs","lineNumber":192,"sourceCode":"                    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');\n    }\n\n    Ok(out)","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/zellij-org/zellij/blob/98a0837077492d53dd252ab30bc3e43e41e504f4/xtask/src/assets.rs#L174-L210","documentation":"`export default` and `export *` are hard-rejected by the flattener: a default export has no name to strip and would break the concatenated single-scope bundle, and star re-exports would collide with other modules' top-level declarations.","triggerScenarios":"Writing `export default function init() {}`, `export default class Widget {}`, or `export * from './utils.js';` in any module under zellij-client/assets.","commonSituations":"Porting code from npm-style ES modules that use default exports; attempting to create a barrel file that re-exports a whole module.","solutions":["Give the export a name: `export function init() {}`, then update callers to `import { init } from ...`","Replace `export *` with explicit named re-exports: `export { a, b } from './utils.js';`"],"exampleFix":"// before (rejected)\nexport default function init() {}\n\n// after\nexport function init() {}","handlingStrategy":"validation","validationCode":"if grep -nE '^export (default|\\*)' zellij-client/assets/*.js; then\n  echo 'export default / export * are not supported by the bundler'; exit 1\nfi","typeGuard":"fn is_unsupported_export(line: &str) -> bool {\n    line.starts_with(\"export default\") || line.starts_with(\"export *\")\n}","tryCatchPattern":null,"preventionTips":["Use named exports everywhere in the web client; there is no default-export slot in the flattened bundle","Replace barrel-style star re-exports with explicit named re-exports"],"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"}