KubeJS (Old)

KubeJS (Old)

3M Downloads

Last version requires unreleased version of Rhino

Abalieno opened this issue ยท 8 comments

commented

Minecraft Version

1.18.2

KubeJS Version

kubejs-fabric-1802.5.5-build.546

Rhino Version

not available

Architectury Version

architectury-4.9.83-fabric

Forge/Fabric Version

fabric-api-0.58.0+1.18.2

Describe your issue

The last version on CF requires an update to Rhino not currently out.

loir

Crash report/logs

No response

commented

CurseForge is taking its sweet time approving the Rhino .jar for some reason... For now you can use the build from our Maven https://maven.saps.dev/static/minecraft/dev/latvian/mods/rhino-fabric/1802.2.0-build.232/rhino-fabric-1802.2.0-build.232.jar

commented

Your problem is exactly what I said.
You are defining those two variables without using let or const.

commented

Then why it only gives an error for one but not the others? They are all defined the same way.

And if this is now required it means rewriting the whole script. I guess I'll avoid updating if that's the case. It's not my own modpack, I'll see what happens.

commented

Once the error happens KubeJS stops processing the rest of the script. If you fix the first one then the next one will error and so on.

commented

Without opening a new issue...

I've run with the latest Kubejs and Rhino, but now logging into the game I see script and tag errors that aren't shown if I plug back in the previous versions.

Are there incompatibilities or now the system is more strict?

commented

I do not know a full list of changes, however there is one major change that could break some scripts. Variables now require let or const to declare them.

// Valid in previous versions
list = []
variable = 'foo'
list.push(variable)
variable = 'bar'

// Now needs to be like so
const list = []
let variable = 'foo'
list.push(variable)
variable = 'bar'

If that is not the only problem then can you provide the script and logs either in the discord or make a new discussion about it.

commented

yukyue

Nope, these are shown in chat. I've highlighted the two errors showing in red. In between all the warnings (I don't have Tech Reborn in here, so some of those could make sense).

What's weird is that the old version of kubejs/rhino don't show any error nor warnings. I'm wondering if the errors were always there but just not shown.

ukyukee

That's the line of the error (scripts are from the pack Incremental Industries on cf, I've only done minor edits that do not touch this).

yukiyui

They seem to be defined further down. I'm not sure what's wrong here, or why the error is only for lv_cables since there are different cables all defined the same way.

The first question is why these errors only show up after KubeJS update, since everything else is exactly the same and rolling back the two mods also seems to remove those errors.