Open ak1dos opened 3 years ago
What does it mean, that this has been set to "plugin update needed"? Is there any plan for solving this? Any idea regarding the timeline? My project is blocked by this issue.
Any news here? We cannot expect to use electron without a Filesystem access ...
@IT-MikeS
Couldnt we add it from here: https://github.com/ionic-team/capacitor/tree/2.x/electron/src/electron directly to @capacitor-community/electron
sources?
Or should I create a @capacitor-community/filesystem
plugin which just implements it for electron? What is the best approach here?
After 4 is released the official file system plug-in for capacitor will need a pr giving it electron support.
At this point you can either create your own plugin or expose your own file api using electrons context bridge system for use in the renderer processes
@IT-MikeS
thanks for the reply. I am currently trying to create my own plugin implementing the Filesystem
API.
So far I kinda got it working but am running into an issue where the Promises of the plugin are never resolved. I do not know why this is the case as my other plugins do not have this issue (edit: my other plugins now also have this issue ...):
https://github.com/digaus/capacitor-community-filesystem
The calls are working (folders and files get created when using mkdir
or writeFile
) but they are never resolved or rejected.
When the Plugin is supposed to reject, I get following error;
Terminal:
args
[ { path: 'files', directory: 'DOCUMENTS', recursive: false } ]
theCall
[Function: mkdir]
isPromise
true
(node:16100) UnhandledPromiseRejectionWarning: Error: EEXIST: file already exists, mkdir 'C:\Users\User\Documents\files'
(Use `electron --trace-warnings ...` to show where the warning was created)
(node:16100) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:16100) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Dev Tools:
sending sync ipc from renderer of channel: Filesystem-mkdir
TypeError: f.mkdir(...).catch is not a function
at e.<anonymous> (9289.8eb515d713fc4a521e0b.js:1)
at Generator.next (<anonymous>)
at s (9289.8eb515d713fc4a521e0b.js:1)
at e.invoke (polyfills.4efd05b7e2c2183e44e6.js:1)
at Object.onInvoke (main.9a92667a6a0c7cd9525e.js:1)
at e.invoke (polyfills.4efd05b7e2c2183e44e6.js:1)
at t.run (polyfills.4efd05b7e2c2183e44e6.js:1)
at polyfills.4efd05b7e2c2183e44e6.js:1
at e.invokeTask (polyfills.4efd05b7e2c2183e44e6.js:1)
at Object.onInvokeTask (main.9a92667a6a0c7cd9525e.js:1)
Any idea whats the issue here?
What version of the platform are you using out of curiosity?
I added a pull-request to the default Capacitor plugins repo that adds support for Electron to the Filesystem plugin: https://github.com/ionic-team/capacitor-plugins/pull/792
I added electron to my capacitor project, I'm having problems with the Filesystem plugin. I downloaded some pdf files and saved with the method
my problem is being able to show them to electron api. if I try to fetch the uri of the saved file I see it with the Filesystem plugin, but I don't understand where it is saved or how to use it with electron.
console.log (result.uri) /DATA/example.pdf