Comments (4)
@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.
@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](https://private-user-images.githubusercontent.com/50979153/298826392-783b3860-32f2-4889-827a-06dfd4b8092b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkyOTE2MDIsIm5iZiI6MTcxOTI5MTMwMiwicGF0aCI6Ii81MDk3OTE1My8yOTg4MjYzOTItNzgzYjM4NjAtMzJmMi00ODg5LTgyN2EtMDZkZmQ0YjgwOTJiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI1VDA0NTUwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE5YTdlNTQ2Nzc2NjhkYWRiYTM3MWE1YWJhYmEwZDcyNmQ0MmYyNTlmNWJiNDk3MzU3YmQ4Y2UyMGQ3ZTdhNjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.By0fYgVt30ep-K4r_hfZJGx4UJ7pRFiY-Fi7sYRKssc)
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.
@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):
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.
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)
- Feature request: webview HOT 8
- Error: execution of an external program failed if callJs in thread. HOT 3
- any kind of error in callJs leads to JSON parse error, original error disappears HOT 2
- Adding: google-chrome-stable HOT 2
- CallJs in try/except Causes Segfault HOT 3
- Example crash HOT 2
- CrossBrowdy And GraBulma Support? HOT 1
- MIME type HOT 1
- Windows build does not works standalone HOT 1
- Cannot install neel. HOT 3
- [WebView] automatic conversion of specified parameters of a procedure to call it simply by string HOT 6
- [Question] Using Neel for a web application? HOT 2
- Curiosity HOT 1
- Error: undeclared identifier: 'callProc'
- Calls to frontend are too slow/blocking HOT 9
- Suggestion : Use Axino widgets instead of HTML + CSS HOT 3
- Application doesn't start if not on the same drive letter as Chrome HOT 3
- Contributing to the project HOT 7
- filePicker example does not compile HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neel.