compartment-disposed: Disposed isolation instance
Cause
Code attempted to use a Compartment or ESM execution instance after dispose(), or disposal canceled an unfinished classic script evaluation.
Troubleshooting
- Use the stack trace to identify whether script evaluation, module import, or another instance operation failed.
- Check the order of
dispose()and asynchronous work. Look for timers, callbacks, or pending promises that still use the old instance. - Check whether the remount flow tries to reuse an instance that has already been disposed.
Solution
If the task needs to finish, wait for evaluation or import to complete before disposing the instance. If disposal is an intentional cancellation, handle the rejected promise and stop subsequent work.
dispose() is terminal cleanup. Unlike unmount(), it does not allow remounting the same instance. Create a new instance and mount it when the micro app needs to run again.
