Giter VIP home page Giter VIP logo

Comments (4)

Niminem avatar Niminem commented on May 20, 2024 1

@CyuHat That's awesome, glad to hear everything is working as intended now! Remember, if you use -d:release Neel will embed your assets inside of the executable itself so you don't have to have to worry about that. Debug builds are just for your testing!

from neel.

Niminem avatar Niminem commented on May 20, 2024

@CyuHat Thank you for the kind words and I'm glad I could help you on the journey of learning Nim! While I don't have any experience at all with cross-compiling from Linux to Windows, the issue seems that it may be from the procedure that finds chrome. To be a little more performant, it uses a 'when' statement (which is assessed at compiletime) to figure out which OS it's compiling to and uses that path. That may be the reason. I'm not exactly sure how Nim handles this internally when cross-compiling:

Snag_63cfcdb

Another guess is that it could be a window's security issue when running the application?

Those would be my two guesses. Please let me know when you manage to figure this out

from neel.

CyuHat avatar CyuHat commented on May 20, 2024

@Niminem thank your for your fast and precise answer! I will check both hypotheses and come back to you if I find something. Meanwhile I have done some tests. I think that Neel manage to find the chrome browser in windows since it open a chrome window (text in french):

localhost error

The screen is the same as if I haven't added the -d:release flag to attach the assets folder (maybe it is related). Furthermore, adding the assets folder to a Linux executable (compiled without the -d:release) solve the issue, but not for a Windows cross-compiled one. Is it maybe something relevant to check?

from neel.

CyuHat avatar CyuHat commented on May 20, 2024

Hi @Niminem
Good news, there is no problem with Neel. The error was on my side. After asking my brother to test my app on his linux machine, he realized that it was looking for the assets/index.html in a path from my computer. It is because I have written the full path instead of a relative path in the startApp() macro:

# Copied from the filepicker.nim example - line 20
startApp(webDirPath = currentSourcePath.parentDir / "assets")

After replacing it with a relative path, it worked under Windows too:

startApp(webDirPath = "assets")

Then, all I need is the assets folder alongside the executable. I apologise for the false issue and thank you for your valuable time!

from neel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.