wurstscript / WurstScript

Programming language and toolkit to create Warcraft III Maps

Home Page:https://wurstlang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Couldn't import resources. null" when compiling from the command line

TheSkullbot opened this issue · comments

Describe the bug
When compiling the example map from the command-line, the following java error message appears during compilation.
Couldn't import resources. null
The maps compiles itself without error after clicking OK, but it's annoying to click that error box to continue.
Happens with the Example Map, the Island Troll Tribes map and of course my own map.

What I already tried

  • Try with another map (IslandTrollTribes) -> not fixed
  • Try with minimum scripts (WurstBareboneTemplate) -> not fixed
  • Remove the imports folder from project -> not fixed, it triggers the bug twice per compilation
  • Fill the imports folder from project with random files -> not fixed
  • Remove some files from the original map.w3x -> not fixed
  • Delete ~/.wurst/ folder and reinstall from latest WurstSetup.jar -> not fixed

How I "fixed" it
I just created empty an imports folder in my wurst directory, next to my ExampleClass.wurst files
So I know have two imports folders, one in the workspace root, and one in the wurst subfolder.
I don't think it's an intended behaviour to check this folder here, but creating it works and prevents the popup from appearing.

Steps to reproduce

  1. Use WurstSetup.jar to create a new project (with StdLibs only)
  2. Navigate to the project folder using CMD / Powershell
  3. run ~\.wurst\grill.exe build ExampleMap.w3x
  4. The error should show up after ? Building project.. in the console
  5. Click OK
  6. The build continues/ends successfully

Logs
https://gist.github.com/TheSkullbot/aa823eaa6afbb910f1628aa7f239c4d6

Additional info
I'm running the latest update of Win10 Pro
openjdk version "1.8.0_282"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_282-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.282-b08, mixed mode)

FYI The issue was not present in previous versions of WurstScript compiler (can't tell the exact version, maybe around May 2020)

Thanks for the detailed report. Are imports actually picked up or not? Because this error and your solution (imports in wurst folder) would suggest it is trying to import from the wrong path. If it is importing correctly and still showing the error, I will just push a fix for opening the dialog.

Yeah, I put two differents files in both folders, and both files ended up in the final MPQ, so both imports folders seems to be used.

I never noticed it because I'm rebuilding the MPQ with MPQEditor command-line using the generated war3map.xxx files, but Wurst tries to import files from the "imports" folders of every dependencies, which seems to be the expected behaviour.

By the way, and I think I already saw an issue about this, the generated w3x file (using grill build) is twice as big as the one built from scratch using MPQEditor command-line, with every files having the same size in both archives 🤷

hi, what's the status on this?

Just tried to remove both imports folder causing issues in the past and rebuilt map from command-line.
No error appears, so it seems fixed as of build 1339 (1.3.4.1-jenkins-WurstSetup-157) 👍🏻

Ok cool, I pushed a fix attempt some time ago but I forgot to update this issue