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
fs.existsSync is not a function #395
Comments
I solved it changing in FileSync.js at line 11:
to
Now it seems to works! |
Before close this issue, it can be good give some feedback from others, or if this fix works, a pull request. |
This is a common electron/webpack bundle issue people have that is not specific to lowdb. If there is no config issues in your code, this issue belongs with the many other similar ones on webpack. You wouldn't have this issue if you weren't using webpack. Think of it like this, if the whole point of using webpack is because it bundles your code, what point is there in using it if it cant bundle your code. |
Many others dependencies works for me. UPDATE |
I guess you are running your code in the renderer thread and not in the main thread, which is a cause of a lot of issue with electron when using library designed for Node. |
As I told, my code is wrapped in angular project, and I don't think it have a main thread or method to run code on it. So all code is managed by angular. But my app have to run on electron framework, so how it works now is fine for me. |
I resolved the issue thanks to this answer. But got it again when app was built. |
For anyone who is still having this issue:
|
My app work well after built, but your answer is very good for a global preload for all your plugins. Very good! @ShaxXxboz |
I ran into this problem today on a simple React app built using the create-react-app boilerplate. What would be the right steps to take in that case? Maybe we could add a little section to the readme for users who wanna use create-react-app together with lowdb or even provide a template. |
I have the same issue when used config.externals = {
"fs": 'require("fs")'
}; I used Angular 8 |
Hi,
I'm developping an app with angular 9 and electron.
I'm trying to using this db but I'm unable to make it work.
This is my DBHandler typescript code:
And to compile it, I must set this on my package.json:
After compiling and lunch app, in electron dev tools I read this error:
read | @ | FileSync.js:32
I hope someone can help me.
Thank you
The text was updated successfully, but these errors were encountered: