Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Error loading native node module after upgrading from 0.6.0 to 1.0.2 #37

@pdehne

Description

@pdehne
  • Operating System: Windows
  • Node Version: 12.6.3
  • NPM Version: 7.6.0
  • webpack Version: 5.24.2
  • node-loader Version: 1.0.2

Expected Behavior

I am using a custom native node module in my Electron application. When using node-loader 0.6.0 it is loading fine. When using node-loader 1.0.2 with the very same node module (no recompilation) I get an error.

Actual Behavior

The error thrown is:

soniccore.node:5 Uncaught Error: node-loader:
Error: Invalid package C:\d\sw\trunk\SonicCare\node_modules\electron\dist\resources\electron.asar
at Object../build/Release/soniccore.node (soniccore.node:5)

Code

// webpack.config.js

target: "electron-renderer",

{
    test: /\.node$/,
    loader: 'node-loader',
    options: {
        name: '[path][name].[ext]'
    }
}

// The complete webpack.config.js:
// https://gist.github.com/pdehne/54a6a6f91435e332c70d5e00abeed20f
import soniccore from '../build/Release/soniccore.node';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions