Skip to content
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

wasp start explodes if file from ext/ dissapears after it listed it but before it copies it #187

Closed
Martinsos opened this issue Feb 20, 2021 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Martinsos
Copy link
Member

Martinsos commented Feb 20, 2021

What Wasp does is: it listens for file changes in ext/ directory, and in .wasp file. If there are any changes, it runs compilation step. First part of that step is that it takes note of all the files in the ext/ dir, remembers them, but does not read them, just does some processing (figuring out what code to generate), and then in a second or so it actually starts copying them. So some other change triggered the compilation step and then it looked in the ext/ dir and saw the image there, but the moment later it wasn't there any more so when it tried to copy it, it exploded. Maybe you deleted multiple files at once so deletion of another file was a trigger and Wasp actually managed to see the image before it got deleted. Might also be cause by checking out previous commit.
Fix should be easy, we just need to tell it to not worry if file is not there any more and just ignore it.
This will probably also fix the problem we have with Vim swap files dissapearing in the middle of the compilation, which causes the same problem.

Example of error message:

 wasp-bin: .../workspace/hello-wasp/MyNewApp/ext/waspLogo.png: copyFile:atomicCopyFileContents:withReplacementFile:copyFileToHandle:openBinaryFile: does not exist (No such file or directory)

Thanks @ricklamers for reporting this!

@Martinsos Martinsos added bug Something isn't working good first issue Good for newcomers labels Feb 20, 2021
@xrendan
Copy link

xrendan commented Feb 21, 2021

I also get this while editing files in Webstorm normally:

Looks like Webstorm (and other Intellij editors presumably) create a temporary file on edit that wasp start picks up and then crashes when the buffer is saved which makes editing in WebStorm impossible if you want to develop iteratively.

Error:
wasp-bin: /home/brendan/dev/personal/GeoPrinter/ext/MainPage.js~: copyFile:atomicCopyFileContents:withReplacementFile:copyFileToHandle:openBinaryFile: does not exist (No such file or directory)

@matijaSos
Copy link
Contributor

@xrendan thanks for reporting, you identified the error correctly! This should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants