Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

showing error: "fs.existsSync" is not a function #50

Open
kamleshkhatvani opened this issue Sep 1, 2017 · 2 comments
Open

showing error: "fs.existsSync" is not a function #50

kamleshkhatvani opened this issue Sep 1, 2017 · 2 comments

Comments

@kamleshkhatvani
Copy link

Hi,
I am running electron-edge for calling method from C# DLL in nodejs. while including electron-edge i am getting this error : "fs.existsSync" is not a function

declare var require: any
var edge = require('electron-edge');
var newapi= edge.func({
assemblyFile: 'C#.dll',
typeName: 'abc.def',
methodName: 'C#api'
});

i am using ionic and electron.

can you please guide me to solve this error. i am totally new to web-technologies.

Thanks,
Kamlesh Khatvani

@jeremiah-c
Copy link

i had ran into a similar problem where I was using a <script type="text/javascript" src="index.js"/> tag in my index.html and I needed to use a require tag; <script>require("./index.js")</script>. Without using a require tag, I don't think node modules like fs will resolve. Also, I don't think indirectly using fs in a browser tag will work.

@elijahmontenegro
Copy link

elijahmontenegro commented Nov 29, 2018

Hi Im having the same issue. I've updated my edge.js and build.bat accordingly please help us @kexplo

....\node_modules\electron-edge\lib\edge.js:3 Uncaught TypeError: fs.existsSync is not a function
at Object.require.56.fs (....\node_modules\electron-edge\lib\edge.js:3)
at newRequire (ce54e46d57234ad37175c2d1617a765d.js:42)
at localRequire (ce54e46d57234ad37175c2d1617a765d.js:48)
at Object.require.10.react (components\MainSection.js:5)
at newRequire (ce54e46d57234ad37175c2d1617a765d.js:42)
at localRequire (ce54e46d57234ad37175c2d1617a765d.js:48)
at Object.require.7.prop-types (pages\HomePage.js:4)
at newRequire (ce54e46d57234ad37175c2d1617a765d.js:42)
at localRequire (ce54e46d57234ad37175c2d1617a765d.js:48)
at Object.require.5.prop-types (modules\MainRouter.js:5)

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

3 participants