-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
node.js - fs.js - writefilesync and renamesync - file doesn't exist before attempting to rename #102
Comments
Hm, just noticed there is always |
Looks like the same issue is happening to \win32\Kha\Tools\khamake\out\ImageTool.js as well. When it reexports, it overwrites the file, and renameSync is running before the rewrite operation is completed, giving the following error:
|
Im running the above function right before fs.renameSync on ImageTool.js and ShaderCompiler.js.. it seems to be working. Probably not the best solution lol Im not a programmer by trade. |
Now I get it. This is running in --watch mode and happens while the program is running, right? Something like fileready might just be the right fix then. |
I am still confused since there is no --watch used in armory but the Recompiling/Reexporting messages are signs of that. Can't get to reproduce on my machine for some reason. @fractalfederation does it error out even on the default scene with a single cube, or just more complex ones? |
Yea it errors out on default scene. I just got the error again with nothing but a cube. I guess I did my function wrong and it was just a coincidence that it stopped getting the error after I added it yesterday. |
I've been using the above code. It still errors and sometimes it errors forever. I looked at the build/html5/ directory for the image and it was already there without the .temp at the end of the file name. Adding the .temp at the end of the image allowed the script to finish. This was with a fresh build, I ran Clean Project which deleted the build directory. So maybe it is renaming file and trying a second time? or the file is created initially without the .temp and a rename is unnecessary? I am such a noob lol Here is the error:
|
I got somewhat similar(but not the same) trouble on Windows 10 machine today targeting html5. Using |
It seems to be two different issues, it happens with the shader files and image files. Sometimes it tries to rename a file that doesn't exist, but if you wait and try again, then it exists and renames successfully. Other times, the file is already renamed. Here is the workaround I am currently using:
Hope this helps. If you figure out a fix, I subscribed and get the message right away, so I'll hop on and test it. |
I checked mine, I didn't see any periods but I do have hyphens, ampersands, underscores and even cyrillic characters. Sure it wasn't a coincidence? When I ran build multiple times, it would create the missing file on the last attempt and no longer error out on that particular file. If you run it enough times, it eventually gets through all the missing files. |
There are probably several ways to get this error. In my case, even if I run build multiple times and get the missing files, at the end I always get a black screen (html5 target). Unfortunately I don't know enough to analyze, I just hope it helps to understand and fix the problem. |
(updated)
|
The dot problem was a separate thing which is now also fixed. |
I was getting this error with Armory3D
Here is my quote from Armory3D issue: #176
The text was updated successfully, but these errors were encountered: