{"record":{"id":"fd48c349eca1dfdf","repo":"gleam-lang/gleam","slug":"a-module-s-function-must-be-named","errorCode":null,"errorMessage":"A module's function must be named","messagePattern":"A module's function must be named","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler-core/src/javascript.rs","lineNumber":1180,"sourceCode":"        }\n\n        // If there's an external JavaScript implementation then it will be imported,\n        // so we don't need to generate a function definition.\n        if function.external_javascript.is_some() {\n            return None;\n        }\n\n        // If the function does not support JavaScript then we don't need to generate\n        // a function definition.\n        if !function.implementations.supports(Target::JavaScript) {\n            return None;\n        }\n        let function_source_mapping = self.source_map_tracker(arena, function.location.start);\n\n        let (_, name) = function\n            .name\n            .as_ref()\n            .expect(\"A module's function must be named\");\n        let argument_names = function\n            .arguments\n            .iter()\n            .map(|arg| arg.names.get_variable_name())\n            .collect();\n\n        let function_doc = match &function.documentation {\n            None => EMPTY_DOCUMENT,\n            Some((start, documentation)) => {\n                docvec![\n                    arena,\n                    // 3 is the length of the \"///\" documentation marker.\n                    // Start is the index of the actual content, so we need to subtract\n                    // the length of the marker.\n                    self.source_map_tracker(arena, *start - 3),\n                    jsdoc_comment(arena, documentation, function.publicity),\n                    LINE_DOCUMENT\n                ]","sourceCodeStart":1162,"sourceCodeEnd":1198,"githubUrl":"https://github.com/gleam-lang/gleam/blob/7e623aa83da3776faee50ca4ab9a6c40124acd95/compiler-core/src/javascript.rs#L1162-L1198","documentation":"Error \"A module's function must be named\" thrown in gleam-lang/gleam.","triggerScenarios":"Thrown at compiler-core/src/javascript.rs:1180 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7e623aa83da3776faee50ca4ab9a6c40124acd95","analyzedAt":"2026-08-17T00:07:02.091Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}