couldn't read src/../dist/index.html
Closed this issue ยท 18 comments
error: couldn't read src/../dist/index.html: No such file or directory (os error 2)
--> src/main.rs:38:32
|
38 | .content(Content::Html(include_str!("../dist/index.html")))
|
You have to run npm run watch-webpack
first
error: couldn't read src/../dist/index.html: No such file or directory (os error 2)
--> src/main.rs:38:32
|
38 | .content(Content::Html(include_str!("../dist/index.html")))
|
Please note that the editor is in early alpha as of now. I've hardcoded the initial starting directory at: https://github.com/ShashankaNataraj/Juggernaut/blob/master/src/web/app.js#L19 . You might want to change this before starting the editor.
@christiansakai Thanks for replying to the question! Would appreciate any and all help in writing this editor!
@ShashankaNataraj this is really awesome work! I am primarily a JS developer but recently started Rust I am not that advanced in Rust but I can do stuff around. I'd love to help contributing. Any idea where to start digging this up in the code base? Any list of features/roadmap?
@christiansakai Here you go: https://github.com/ShashankaNataraj/Juggernaut/projects. This project could use help in both the JS and Rust portions, whichever you're comfortable with!
@ShashankaNataraj Awesome. Right now maybe it is good to wait until you clean up the code structure and introduce basic features. That would help a lot for people who wants to contribute
Hi, I am on windows and can't run the code, seems that the packaged js code with spread operator is not supported by IE
@rrandom Thanks for reporting the bug, In our webpack config, we need to transpile the ES6 code into ES5. I currently do not have access to a windows machine.
Any PRs would be much appreciated.
@rrandom the webpack is using babel 7, here it is to configure it using IE https://babeljs.io/docs/en/babel-preset-env#targets
@christiansakai @rrandom I've added a fix for this in:
b7453e3
Can you please check now? I dont see any spread operators in the compressed file, so hoping this fix works for you.
You can do : https://github.com/ShashankaNataraj/Juggernaut#build-from-source
@ShashankaNataraj It works! thanks for the quick fix
@rrandom No problemo ! Thanks for raising this issue!
Youll need to open a dir as a project before starting to edit files. Please go through:
https://github.com/ShashankaNataraj/Juggernaut/wiki/FAQ's
@ShashankaNataraj Off topic, but if we think that webpack is too complicated for our use case, we can use parcel https://parceljs.org/
@christiansakai Thanks for the suggestion, Ive looked at parcel before, but I see that It has some issues with generating a single bundled file: parcel-bundler/parcel#1704
Generating a single file is of utmost importance in the current approach because juggernaut currently reads only one startup html file containing everything: https://github.com/ShashankaNataraj/Juggernaut/blob/master/src/main.rs#L34
Currently the index.html
file includes Ace from a CDN, I intend to change that very soon. And any hits to the disk after the initial html is loaded is only for files the user wants to read / write.
As a side note, sometimes I think having the files served over HTTP through a random port does give a lot of flexibility in terms of development and tooling instead of this single file approach to loading everything..
@ShashankaNataraj Ah okay. Yeah in that case just use Webpack. Webpack is good enough for a lot of use cases and very flexible.
@ShashankaNataraj Just discovered that Parcel support Rust extension compiled to WASM https://parceljs.org/rust.html
@christiansakai Yes it does! I was exploring parcel for my resume(https://bitly.com/shashankas-resume) a few days back when I found the rust part of the documentation.
But AFAIK the code that runs in WASM will not be able to access the file system, right?
If I am not mistaken no it cannot access the file system, so we do still have to use JS.