Encountering Bug in Handcalcs Demo and Issues with a borged state of the package environment

What happened (the time is important, as the problem depends on the execution, so there seems to be some problems not only with the package, but also with the way environments are built).

First I tried the example notebook Handcalcs.jl
which has a bug (ERROR: LoadError: ParseError:# Error @ /home/runner/.julia/packages/Unitful/sx - Pastebin.com)

After that I thought, well let’s just see which package is creating the error.
I created a new notebook with only Unitful and Handcalcs, which worked, after I added StructuralUnits package the issue started to occur, but even after removing it, closing the notebook, restarting everything the problem was still there now and it is not going away anymore.

Woud love to know what you do in these kind of cases.

That looks interesting, because for the original code lines

a difference to your error message is that their Base.:* is Base. * in your error message (and the reason for the error message).
I am a bit unsure where that difference / change comes from, but if something changed the code file, then it would explain why the error persists.

Oh, I think I found something interesting. You are running Unitful 1.23 (my code above is from the most recent 1.29). and there

we have that old code and it seems older Julia versions allowed that.

StructuralUnits.jl is already on 0.3.0 on their main branch which would allow for newer versions, so maybe we should ask them to register that.
Or we should check what keeps the notebook on Unitful 1.23. Fixing that should fix your error (and we should let the notebook owner/hoster know).
All I could find about this is the change here Remove extra space in definition of `Base` methods - Pull Request #817 - JuliaPhysics/Unitful.jl - GitHub, but not where the Julia parser changed to no longer accepting the space. I personally always wrote the :* as far as I can remember.

So, until it is registered, you may be able to work around the issue by installing it from the main branch using the following command:

pkg> add StructuralUnits#main

or

import Pkg; Pkg.add(url="https://github.com/co1emi11er2/StructuralUnits.jl", rev="main")

do you know how can I do this within Pluto? It complains that if I use Pkg that it overwrites Pluto’s handling of the packages.

begin
	import Pkg
	Pkg.activate(mktempdir())
	Pkg.add(url="https://github.com/co1emi11er2/StructuralUnits.jl", rev="main")
	Pkg.add("Handcalcs")
	Pkg.add("PlutoUI")
	Pkg.add("LaTeXStrings")
	Pkg.add("PlutoPlotly")
	Pkg.add("Markdown")
	Pkg.add("TestHandcalcFunctions")
	
	using Handcalcs, StructuralUnits, PlutoUI, LaTeXStrings, PlutoPlotly, Markdown, TestHandcalcFunctions
end

Or: