{"record":{"id":"636a63231afaf31a","repo":"swc-project/swc","slug":"assign-property-in-object-literal-is-not-a-valid-s","errorCode":null,"errorMessage":"assign property in object literal is not a valid syntax","messagePattern":"assign property in object literal is not a valid syntax","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/swc_ecma_utils/src/lib.rs","lineNumber":1955,"sourceCode":"                            if let PropName::Computed(e) = key {\n                                if e.expr.may_have_side_effects(self) {\n                                    return true;\n                                }\n                            }\n\n                            value.may_have_side_effects(self)\n                        }\n                        Prop::Getter(GetterProp { key, .. })\n                        | Prop::Setter(SetterProp { key, .. })\n                        | Prop::Method(MethodProp { key, .. }) => {\n                            if let PropName::Computed(e) = key {\n                                e.expr.may_have_side_effects(self)\n                            } else {\n                                false\n                            }\n                        }\n                        Prop::Assign(..) => {\n                            unreachable!(\"assign property in object literal is not a valid syntax\")\n                        }\n                        #[cfg(swc_ast_unknown)]\n                        _ => true,\n                    },\n                    PropOrSpread::Spread(SpreadElement { .. }) => {\n                        has_spread = true;\n                        true\n                    }\n                    #[cfg(swc_ast_unknown)]\n                    _ => true,\n                });\n\n                if has_spread {\n                    to.push(ObjectLit { span, props }.into())\n                } else {\n                    props.into_iter().for_each(|prop| match prop {\n                        PropOrSpread::Prop(node) => match *node {\n                            Prop::Shorthand(..) => {}","sourceCodeStart":1937,"sourceCodeEnd":1973,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_ecma_utils/src/lib.rs#L1937-L1973","documentation":"A catch-all arm in the side-effect analysis over object literal properties (swc_ecma_utils lib.rs:1955). The match covers KeyValue, Getter, Setter, Method, and Shorthand props; any unrecognized or unrepresentable prop shape (for example an assignment pattern used as a property value, which is not valid object-literal syntax in swc's Prop grammar) falls into this arm, which declares that shape invalid syntax for an object literal property. The prop node that is not one of the recognized kinds is the input at fault.","triggerScenarios":"Thrown at crates/swc_ecma_utils/src/lib.rs:1955 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Identify the Prop variant that reached the arm (log it) — it indicates an AST produced outside normal swc parsing","Normalize shorthand-with-default properties into key-value form with a default-handling transform before analysis","Treat the invalid prop conservatively as side-effecting (return true) instead of panicking"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5176682b65416c6b5de6b47379ae1588ea3ecb3f","analyzedAt":"2026-08-17T16:16:52.067Z","contentChangedAt":"2026-08-17T16:16:52.067Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}