noble icon indicating copy to clipboard operation
noble copied to clipboard

Error occurred in handler for 'create-connection': Error: Cannot find module './native/binding'

Open akiannillo opened this issue 3 years ago • 2 comments

I'm trying to use noble with electron + webpack but I got this error.

Error occurred in handler for 'create-connection': Error: Cannot find module './native/binding'
    at webpackMissingModule (/Users/xxx/Workspace/xxx-app/.webpack/main/index.js:3633:82)
    at Object../node_modules/@abandonware/noble/lib/mac/bindings.js (/Users/xxx/Workspace/xxx-app/.webpack/main/index.js:3633:173)
    at __webpack_require__ (/Users/xxx/Workspace/xxx-app/.webpack/main/index.js:21:30)
    at module.exports../node_modules/@abandonware/noble/lib/resolve-bindings.js.module.exports (/Users/xxx/Workspace/xxx-app/.webpack/main/index.js:4484:17)
    at Object../node_modules/@abandonware/noble/index.js (/Users/xxx/Workspace/xxx-app/.webpack/main/index.js:98:128)
    at __webpack_require__ (/Users/xxx/Workspace/xxx-app/.webpack/main/index.js:21:30)
    at createConnection (/Users/xxx/Workspace/xxx-app/.webpack/main/index.js:19500:17)
    at /Users/xxx/Workspace/xxx-app/.webpack/main/index.js:19528:5
    at electron/js2c/browser_init.js:201:579
    at Object.<anonymous> (electron/js2c/browser_init.js:161:10005) {
  code: 'MODULE_NOT_FOUND'
}

akiannillo avatar Apr 27 '21 12:04 akiannillo

Make sure to add@abandonware/noble to externals in webpack config

blamay avatar May 04 '21 22:05 blamay

@blamay do you have an example showing how this is done? I'm having trouble figuring out what applies to this situation when I google through the webpack documentation.

jkeating1 avatar Aug 14 '21 22:08 jkeating1