{"record":{"id":"3cc9320ccabce57b","repo":"JetBrains/intellij-community","slug":"attempt-to-compile-nested-form-with-no-nested-form","errorCode":null,"errorMessage":"Attempt to compile nested form with no nested form loader specified","messagePattern":"Attempt to compile nested form with no nested form loader specified","errorType":"validation","errorClass":"CodeGenerationException","httpStatus":null,"severity":"error","filePath":"java/compiler/forms-compiler/src/com/intellij/uiDesigner/compiler/AsmCodeGenerator.java","lineNumber":397,"sourceCode":"        generateButtonGroups(myRootContainer, generator);\n      }\n      catch (CodeGenerationException e) {\n        myErrors.add(new FormErrorInfo(e.getComponentId(), e.getMessage()));\n      }\n      generator.returnValue();\n      generator.endMethod();\n    }\n\n    private void generateSetupCodeForComponent(final LwComponent lwComponent,\n                                               final GeneratorAdapter generator,\n                                               final int parentLocal) throws CodeGenerationException {\n\n      String className;\n      if (lwComponent instanceof LwNestedForm) {\n        LwRootContainer nestedFormContainer;\n        LwNestedForm nestedForm = (LwNestedForm) lwComponent;\n        if (myFormLoader == null) {\n          throw new CodeGenerationException(null, \"Attempt to compile nested form with no nested form loader specified\");\n        }\n        try {\n          nestedFormContainer = myFormLoader.loadForm(nestedForm.getFormFileName());\n        }\n        catch (Exception e) {\n          throw new CodeGenerationException(lwComponent.getId(), e.getMessage());\n        }\n        // if nested form is empty, ignore\n        if (nestedFormContainer.getComponentCount() == 0) {\n          return;\n        }\n        if (nestedFormContainer.getComponent(0).getBinding() == null) {\n          throw new CodeGenerationException(lwComponent.getId(), \"No binding on root component of nested form \" + nestedForm.getFormFileName());\n        }\n        try {\n          Utils.validateNestedFormLoop(nestedForm.getFormFileName(), myFormLoader);\n        }\n        catch (RecursiveFormNestingException e) {","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/compiler/forms-compiler/src/com/intellij/uiDesigner/compiler/AsmCodeGenerator.java#L379-L415","documentation":"generateSetupCodeForComponent throws CodeGenerationException when a form contains a LwNestedForm component but AsmCodeGenerator was constructed with myFormLoader == null. Nested forms can only be compiled through a FormLoader that can fetch the nested .form file.","triggerScenarios":"Running AsmCodeGenerator over a form that embeds another form (nested form component) without supplying a nested form loader to the generator/patcher (e.g. custom instrumentation entry points, or compiling single forms in isolation).","commonSituations":"Third-party build scripts invoking the forms compiler directly without the standard loader; IDE compile of a form snapshot where the loader was deliberately omitted; hot-swap/instrumentation of an isolated class file that references a nested form.","solutions":["Pass a proper nested FormLoader (the one the standard GUI Designer compiler passes) when constructing AsmCodeGenerator for forms containing nested forms","If nested forms are not expected, remove the nested-form component from the .form or fix the wrong component type in the form XML","Compile through the standard build pipeline (JPS/Gradle IntelliJ Plugin) instead of invoking the generator manually"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (formContainsNestedForms(formFile) && formLoader == null) {\n  throw new IllegalArgumentException(\"supply a FormLoader: form embeds nested forms\");\n}","typeGuard":null,"tryCatchPattern":"catch (CodeGenerationException e) if 'no nested form loader specified': wire the standard FormLoader (as JPS forms patcher does) and retry the compile","preventionTips":["Use the standard build pipeline (JPS/Gradle IntelliJ Plugin) which always supplies the loader","If invoking AsmCodeGenerator directly, always pass a FormLoader capable of loading nested .form files","Lint forms for nested-form components before custom instrumentation runs"],"tags":["gui-designer","forms","nested-forms","compiler-config","intellij"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}