module-registration-sealed: Document module registration is closed
Cause
The first call to importDocumentModules() closes the document module set to further registration. Calling registerDocumentModule() afterward throws this error.
Troubleshooting
- Check the order of these two methods in your custom loader or streaming integration.
- Check whether
importDocumentModules()runs before all document modules have been registered. - Look for asynchronous callbacks that submit additional document modules after importing begins.
Solution
Register all modules in the current document before calling importDocumentModules(). Use the Compartment's import() or load() for modules needed on demand afterward. Document module registration cannot be reopened once it has ended.
