Facepunch / sbox-issues

175 stars 12 forks source link

Task Dispose() causing TypeLibrary couldn't find Component #6233

Open Feddas opened 2 months ago

Feddas commented 2 months ago

Describe the bug

When a task calls .Dispose, all components created for that project become missing from GameObjects in the scene. TypeLibrary couldn't find Component errors are shown when pressing play. The errors shown are the same as https://github.com/Facepunch/sbox-issues/issues/4802 The cause of the error seems different.

To Reproduce

  1. Create a component that calls Dispose() on a Task in OnStart()
  2. Save the script to kick off a recompile.
  3. Press play so that OnStart() is run.
  4. Close the s&box editor.
  5. Reopen the s&box editor.
  6. OBSERVED: All custom components are now missing. TypeLibrary couldn't find Component errors when entering playmode.

Expected behavior

Either of the following:

  1. An error about improper use of .Dispose().
  2. The components should load as normal

Media/Files

No response

Additional context

No response

Nolankicks commented 2 months ago

Missing components usually means you are using something not whitelisted.