webpack-contrib / node-loader

node loader for native modules
MIT License
119 stars 43 forks source link

Failing to load .node file after upgrading to 1.0.0 from 0.6.0 #23

Closed geraintwhite closed 4 years ago

geraintwhite commented 4 years ago

Expected Behavior

After upgrading to 1.0.0 .node file would be loaded without error.

Actual Behavior

After upgrading to 1.0.0 .node file is not loaded with the following error Uncaught Error: node-loader: Error: ENOENT, renderer/1c4a1496ce4a9c4a7b5b692ccaba69d9.node not found in node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar.

It works fine when I downgrade back to 0.6.0.

Code

// webpack.config.js
{
  target: 'electron-renderer',
  module: {
    rules: [
      {
        test: /\.node$/,
        use: require.resolve('node-loader')
      }
    ]
  },
  node: {
    __dirname: false
  }
}
alexander-akait commented 4 years ago

@grit96 Please create reproducible test repo and do not ignore How Do We Reproduce?, I will reopen issue after you update the issue template