SpringChallenge2023 icon indicating copy to clipboard operation
SpringChallenge2023 copied to clipboard

Running test gives empty page

Open dremovd opened this issue 1 year ago • 3 comments

I tried to run Spring2023Main main from vs code on my Mac. It looks like working, but the page http://localhost:8888/test.html is empty (test.html is loading, but it renders to an empty page)

test.html content: https://pastebin.com/a1vcByh6

dremovd avatar May 27 '23 14:05 dremovd

I've got the same problem. @dremovd did you found a solution?

tom-willmowski avatar Jun 17 '23 10:06 tom-willmowski

Try copying the files in src\main\resources\view\assets to src\main\resources\view\assets\assets then recompile

dmortell avatar Jun 18 '23 09:06 dmortell

I found the issue, it is because the view are in typescript which needs to be transpiled in javascript. Since the typescript project has a lot of dependencies, I advise you to use node.js to download them. Here the step to make it work:

  1. install node.js
  2. cd src\main\resources\view
  3. remove file package-lock.json (it contains URL internal to CodinGame company so it will break node.js)
  4. call npm install
  5. call npx tsc --build
  6. in order to reduce drastically the jar size and maven build time, add this to the pom.xml
<build>
   <resources>
      <resource>
         <directory>src/main/resources</directory>
         <includes>
            <include>view/assets/**</include>
            <include>view/graphics/**</include>
            <include>view/*.js</include>
         </includes>
         <filtering>false</filtering>
      </resource>
   </resources>
</build>
  1. in folder containing pom.xml, call maven clean install (the jar will now contain the transpiled typescript)
  2. run the main and enjoy

totof99 avatar Jul 18 '23 03:07 totof99