Im getting error FileError code: 5, message: ENCODING_ERR when file.writeFile

Hi, im using ionic-native/file with cordova-plugin-file in order of write a new csv file. I have the csv data but when i try to do this.file.writeFile(path, filename) it returns:
ERROR Error: Uncaught (in promise): FileError: {“code”:5,“message”:“ENCODING_ERR”}
at resolvePromise (polyfills-es2015.js:4147)
at resolvePromise (polyfills-es2015.js:4104)
at polyfills-es2015.js:4208
at ZoneDelegate.invokeTask (polyfills-es2015.js:3741)
at Object.onInvokeTask (vendor-es2015.js:97815)
at ZoneDelegate.invokeTask (polyfills-es2015.js:3740)
at Zone.runTask (polyfills-es2015.js:3518)
at drainMicroTaskQueue (polyfills-es2015.js:3909)

I have try some options that are in other post but nothing solve me the problem

I would recommend migrating to Capacitor so you can use this API instead. If you insist on sticking with your current stack, read this issue.