Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

cordova.file.dataDirectory calls fail #130

Closed
rockneverdies55 opened this issue Apr 1, 2016 · 14 comments
Closed

cordova.file.dataDirectory calls fail #130

rockneverdies55 opened this issue Apr 1, 2016 · 14 comments

Comments

@rockneverdies55
Copy link

Little bit of background. Using lokijs as frontend db and loki-cordova-fs-adapter as the persistence provider (a script that saves lokijs db to disk).

However, if I have cordova-hot-code-push plugin installed, then cordova.file.dataDirectory call in the script is failing and my app doesn't load.

@nikDemyankov
Copy link
Member

Can you print out in console value of the cordova.file.dataDirectory before chcp plugin installation and after?

@rockneverdies55
Copy link
Author

Now I'm outside so can't check it out. However the value of cordova.file.dataDirectory would be expected to be different before and after chcp installation?

@nikDemyankov
Copy link
Member

This is what I want to check :) If it's crashing because of it - most likely.

@rockneverdies55
Copy link
Author

I see, ok i'll let you know.

@nikDemyankov
Copy link
Member

Thanks

@rockneverdies55
Copy link
Author

Without the plugin I get file:///data/user/0/<reverse_domain_app_name>/files/.

Though when the chcp plugin is installed, I see this in the console: Uncaught TypeError: Cannot read property 'dataDirectory' of undefined

@rockneverdies55
Copy link
Author

Initially the app loads fine. However seconds later (I guess when CHCP completes copying and loading from new location) it becomes empty white screen and the app doesn't come back with the error message (Cannot read property 'dataDirectory' of undefined) in the console

@nikDemyankov
Copy link
Member

Understood, thanks for the info. Will check it out.

@nikDemyankov
Copy link
Member

If it's failing because of cordova.file.dataDirectory being undefined - I should be able to reproduce it by just installing cordova-plugin-file. But it works fine...

Tried to use lokijs and the loki-cordova-fs-adapter - also works both on iOS and Android. Can you please provide step-by-step guide on how to reproduce your issue?

@rockneverdies55
Copy link
Author

That's really weird. I don't think I'm doing anything special. I'll check it out and get back to you.

@nikDemyankov
Copy link
Member

Thanks.

@jeevaraj16
Copy link

I am also have same problem after build using phonegap windows version. It show TypeError: Unable to get property "dataDirectory" of undefined or null reference

please give me solution for this

@nikDemyankov
Copy link
Member

@jeevaraj16 can you give me a step-by-step guide on how to reproduce that? Preferably with new project.

Also, please, share info on what cordova version you are using, node version, ios/android.

@nordnet-deprecation-bot
Copy link
Contributor

👋 Hi! Thank you for your interest in this repo.

😢 We are not using nordnet/cordova-hot-code-push anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork.

🔒 This will now be closed & locked.

ℹ️ Please see #371 for more information.

@nordnet nordnet locked and limited conversation to collaborators Sep 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants