I am new to modding and Java and I had this same problem.
In my mods.toml file I have this line:
modId="fdmapexplorer" #mandatory
FDMapExplorer is the name of my mod.
I found this in my main mod java file:
@Mod("assets/fdmapexplorer")
I know I didn't type that in so at some point my IDE(IntelliJ IDEA) may have tried to help. Anyway...
I changed it to:
@Mod("fdmapexplorer")
AND TA-DA! Everything works!
Hopefully this helps you.