diego3g / electron-typescript-react

:electron: An Electron boilerplate including TypeScript, React, Jest and ESLint.
1.45k stars 295 forks source link

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

Closed zhex900 closed 3 years ago

zhex900 commented 3 years ago

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.

diego3g commented 3 years ago

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!