Giter VIP home page Giter VIP logo

Comments (10)

ghbutton avatar ghbutton commented on June 14, 2024

I think it is more because I am using react-scripts from create-react-app

from libsignal-node.

mayfield avatar mayfield commented on June 14, 2024

Does that mean your root folder is the src/ directory? You'll need a parent folder that contains the protos dir for it to function properly. Tbuild env issue?

from libsignal-node.

ghbutton avatar ghbutton commented on June 14, 2024

I created the simplest electron app following this blog post: https://medium.freecodecamp.org/building-an-electron-application-with-create-react-app-97945861647c

And then I included a file (project/src/Controller.js) which require('libsignal');

I think the create-react-app somehow overrides the __dirname and I get a file not found error

from libsignal-node.

mayfield avatar mayfield commented on June 14, 2024

I'll see if I can't repro this weekend. In the meantime if you manage to identify what the actual FS layout is inside that electron sandbox or an alternative to __dirname (which I'd happily take a PR for), let me know.

from libsignal-node.

ghbutton avatar ghbutton commented on June 14, 2024

thanks, I will keep trying. So far the only solution I have found is to hard code the path

from libsignal-node.

mayfield avatar mayfield commented on June 14, 2024

Are you by chance using webpack on the node modules?

See: https://codeburst.io/use-webpack-with-dirname-correctly-4cad3b265a92

I still think there might be something amiss in your env. It also looks like webpack and electron have a troubled history with __dirname; I'm going to hold off on merging your pull request (#6) as it makes some assumptions about / being a special directory and the module.i property is not one that resolves in my system; So something isn't right. That guide is too involved for me to get into, so I'm going to apply a small compatibility change to the usage of __dirname in that module and you might try messing with the electron options in your setup, as per that link above (namely the __dirname: false option).

from libsignal-node.

mayfield avatar mayfield commented on June 14, 2024

@ghbutton what version of node are you using? I see some internet chatter about __dirname behavior being different for the new ECMAScript modules (https://nodejs.org/api/esm.html). Looks like it's still experimental but perhaps electron and/or your react env are turning that on. There might be a technique I can use that's compatible with this new module system, so let me know.

from libsignal-node.

ghbutton avatar ghbutton commented on June 14, 2024

I am using version 11.8.0

from libsignal-node.

ghbutton avatar ghbutton commented on June 14, 2024

Yea, I think it might be an electron issue of some kind

from libsignal-node.

ghbutton avatar ghbutton commented on June 14, 2024

thank you

from libsignal-node.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.