diego3g/electron-typescript-react

Error: AWS CRT binary not present in any of the following locations

zhex900 opened this issue · 1 comments

Hi,

I am trying to get aws-iot-device-sdk-v2 to work with electron. After I have added the package. Run my code. I get this error.

> electron-react-typescript@1.0.0 start:electron /Users/jake/Code/electron/electron-typescript-react
> electron .

App threw an error during load
Error: AWS CRT binary not present in any of the following locations:
	/Users/jake/Code/electron/bin/native/aws-crt-nodejs
	/Users/jake/Code/electron/bin/darwin-x64/aws-crt-nodejs
    at Object../node_modules/aws-crt/dist/native/binding.js (/Users/jake/Code/electron/electron-typescript-react/dist/main.js:1498:11)
    at __webpack_require__ (/Users/jake/Code/electron/electron-typescript-react/dist/main.js:20:30)

If I change the electron webpack config to

  node: {
    __dirname: true
  },
App threw an error during load
Error: Cannot find module '/Users/jake/Code/electron/electron-typescript-react/node_modules/
aws-crt/dist/bin/darwin-x64/aws-crt-nodejs'

/Users/jake/Code/electron/electron-typescript-react/node_modules/ aws-crt/dist/bin/darwin-x64/aws-crt-nodejs.node

Is a valid path.

I guess it is something to do with .node Any ideas?

I have added this to electron-typescript-react/webpack/electron.webpack.js

      {
        test: /\.node$/,
        loader: "node-loader",
      },

This makes no difference.

Hey @zhex900, i did a full refactor of this structure to include Electron Forge during the development and build process, can you try recreating the project with the new structure and check if the error persists? Thanks!