Big bug to get component from Needle scene

Hi,

A big bug is appeared after that I only opened my Unity scene.
I’m on the react Setup and, I don’t know why.
After it my component cannot be reached through my scene.

The part of my code in case :

useEffect(()=> {
    if(needle) needle.getContext().then((context) => {
      const nodeScript = GameObject.getComponentInChildren(context.scene, LoadModelsFromNode)

      // console.log(context.scene)
      
      if(nodeScript) {
        // We save the script locally
        setNode({component: nodeScript})
        
        // We add the settings used to load the models
        nodeScript.settings = settings
        
        // We start the loading
        nodeScript.loadAll()
        
        nodeScript.historyPromise.then(() => {
          // And we set the history load from the script
          const actualDate = new Date()
          const structuredDate = actualDate.getDay() + "/" + actualDate.getMonth() + "/" + actualDate.getFullYear()
          const structuredDateYes = (actualDate.getDay()-1) + "/" + actualDate.getMonth() + "/" + actualDate.getFullYear()
          
          // We place the timestamps
          nodeScript.history.map(item => {
            if(item.date == structuredDate) item.timestamp = "Aujourd'hui"
            else if(item.date == structuredDateYes) item.timestamp = "Hier"
            else {item.timestamp = "Précédemment"}
          })
          setHistory(nodeScript.history)
          sendToServer(nodeScript.history)
        })
      }
      
    })
  }, [needle])

I got my context, I got my scene and the Object3D which got the component is in here.

But “nodeScript” is always null, somebody know why ?

Original Post on Discord

by user 224464722878005248

Update: I added a random component and save
After I removed it directly and save

And now it’s fixed, but big fear

by user 224464722878005248

Sounds a bit like something with caching or component gen wasn’t updated correctly / as you expected
Please let us know if you can reproduce it!

In fact when I restart unity, I need to ignore compilation errors.
And when I try to udpate needle it seems to bug :

by user 224464722878005248

by user 224464722878005248

by user 224464722878005248

The top one seem to be from codegen from one of your components?

Don’t recommend ignoring compiler errors - they’ll break everything else most likely.

by user 224464722878005248

The AssemblyResolutionException is a Unity thing; you can disable assembly validation in Player settings
image.png

So what’s LoadModelsFromNode.ts containing? And how does the cs file look?

by user 224464722878005248

It contains all of the code use to load my model in my scene from another server

by user 224464722878005248

by user 224464722878005248

I don’t know what’s appends

by user 224464722878005248

I don’t see this option :

by user 224464722878005248

by user 224464722878005248

That is expected (just typical Unity behaviour) when even one script doesn’t compile

They should reappear once you fix the error in that script, mind dropping the .cs file here?

image.png

by user 224464722878005248