OpenJSCAD.org
OpenJSCAD.org copied to clipboard
auto reload not working after loading a project
Expected Behavior
auto-reload should work
Actual Behavior
it throws error:
Uncaught (in promise) Error: Failed to load file: demo/index.js [NotReadableError: The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.]
I couldn't find any settings in chrome to workaround the issue.
Steps to Reproduce the Problem
- set up a project with index.js in a folder
- open v2 site: www.jscad.xyz and load the project
- check
Enable auto-reload
change some parameters in index.js to trigger a change. model does not update in the browser and the errors are in the console.
Specifications
- Version: v2 www.jscad.xyz
- Platform: mac chrome Version 86.0.4240.75 (Official Build) (x86_64)
- Environment: browser
@crysislinux thanks for this information.
sadly, this is one of those area where the browsers differ in implementation. can you answer a few questions for us?
- Did you use drag-n-drop to load a project, or select a directory using load a project?
- Did the error appear immediately? Or after a few changes?
- Did the WEB UI stop functioning after the error appeared?
Seems to be the standard... Files cannot be re-read if loaded from the file chooser.
CHROME - Drag-and-drop (OK), File Chooser (Exception, NotReadableError) FIREFOX - Drap-and-drop (OK), File Chooser (Exception, NotReadableError) SAFARI - Drag-and-drop (OK), File Chooser (Exception, WebKitResourceError) EDGE - Drap-and-drop (OK), File Chooser (Exception, NotReadableError)
@z3dev
Did you use drag-n-drop to load a project, or select a directory using load a project?
load a project button
Did the error appear immediately? Or after a few changes?
Not work at all on Chrome, sometimes work on Firefox, but mostly not working too.
Did the WEB UI stop functioning after the error appeared?
It just doesn't update on changes, but buttons still work and can load the project again.
To solve the issue, I learned the web package code and implemented a new loader with WebSocket. Now I can create my project with webpack + typescript. it's event-driven and works smoothly, I can load the projects from my localhost or remote workspace(github codespace etc.).
I can make a PR after finalizing it(add retry logic, error handling etc.) if you think it's useful for others.
To solve the issue, I learned the web package code and implemented a new loader with WebSocket. Now I can create my project with
webpack+typescript. it's event-driven and works smoothly, I can load the projects from my localhost or remote workspace(github codespace etc.).I can make a PR after finalizing it(add retry logic, error handling etc.) if you think it's useful for others.
@crysislinux this sounds interesting. A new pull request would be great. And we can give some feedback as to wether the changes can be integrated.
Tried to create an extension for vscode. Seems promising.

Tried to create an extension for vscode. Seems promising.
Cool. Iām sure there are lots of people looking for that extension. Be sure to publish it to the user group.
@z3dev
Be sure to publish it to the user group.
Will do that. Seems like I put more time on tooling than actually building things š
@z3dev
Be sure to publish it to the user group.
Will do that. Seems like I put more time on tooling than actually building things š
Same. š If you want something to do... there are plenty of open issues, and you are welcome to try to fix some of those.
@z3dev
The extension was released š
https://marketplace.visualstudio.com/items?itemName=crysislinux.openjscad
I made a post in the user group: https://openjscad.nodebb.com/topic/178/an-vscode-extension-for-v2