Coder Social home page Coder Social logo

Comments (6)

mmaietta avatar mmaietta commented on August 20, 2024 1

@mbruschi here is my up-to-date webpack config with relevant sections below. Hope that helps!

{
    test: /\.js$/,
    // Finds node addons in build/Release and node_modules
    loader: "node-bindings-loader"
},
{
    test: /\.node$/,
    // Converts paths from source code and resolved paths from `node-bindings-loader` to use __dirname or process.execPath
    loader: "awesome-node-loader",
    options: {
        useDirname: !packDistributable
    }
},
externals: packDistributable ? [ 'permissions', 'electron-deeplink.node' ] : [nodeExternals()],

from node-mac-permissions.

codebytere avatar codebytere commented on August 20, 2024

@glawson to my current knowledge, getting this error means that webpack packed this module, which it should not. I'm pretty sure if you just configure webpack to use this module externally (e.g explicitly don't pack it), & the problem should be resolved & the low level binding will work.

from node-mac-permissions.

glawson avatar glawson commented on August 20, 2024

@codebytere - exactly. Just wanted to make mention of it in case anyone else runs into this error.

from node-mac-permissions.

codebytere avatar codebytere commented on August 20, 2024

Added a note to the README - thanks for the heads up!

from node-mac-permissions.

mmaietta avatar mmaietta commented on August 20, 2024

Just chiming in and potentially resurrecting an old issue. If using es6 imports:

import * as NodeMacPermissions from "node-mac-permissions";

The externals setup can be simplified to:

externals: [{
    'permissions': 'node-mac-permissions'
}]

from node-mac-permissions.

mbruschi avatar mbruschi commented on August 20, 2024

@mmaietta FYI I tried it out with the es6 import but still get the initial error mentioned here: Cannot read property 'indexOf' of undefined. Happy to provide more details but right now don't know what could be useful.

from node-mac-permissions.

Related Issues (20)

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.