aeirola / react-native-svg-asset-plugin

Asset plugin for importing SVG images in React Native
https://www.npmjs.com/package/react-native-svg-asset-plugin
MIT License
68 stars 9 forks source link

Unable to open 'file' for writing #26

Closed antoniovitor closed 4 years ago

antoniovitor commented 5 years ago

Error message: error: bundling failed: Error: vips__file_open_write: unable to open file "/path-to-file/.png-cache/file.png" for writing unix error: Invalid argument

I couldn't use your plugin because of this error. Somehow, the plugin wasn't able to save the file.

Although I couldn't find any code for folder creation, I saw that the plugin was able to create .png-cache folder during the transformation. I found this issue that could help solving this problem, but I do know that the folder was created.

aeirola commented 5 years ago

Hmm, interesting. The plugin itself doesn't do anything special during image writing, just passes the file path to the sharp library after ensuring the parent directory exists.

Could you check that the permissions of the created directory allow writing of the image files? Also, would you mind describing the environment you encountered the issue in? I.e. OS, filesystem, node version, etc. I imagine it will be hard to fix the issue without being able to replicate it first.

aeirola commented 4 years ago

If you happened to be running on windows, you might want to try again with version 0.3.0 which adds support for windows. If that doesn't solve it for your case, you are free to reopen the issue and I'll see if there is something to be done to fix it.