Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running test gives empty page #8

Open
dremovd opened this issue May 27, 2023 · 3 comments
Open

Running test gives empty page #8

dremovd opened this issue May 27, 2023 · 3 comments

Comments

@dremovd
Copy link

dremovd commented May 27, 2023

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

@tom-willmowski
Copy link

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

@dmortell
Copy link

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

@totof99
Copy link

totof99 commented Jul 18, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants