webpack-contrib / node-loader

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

Electron use node-loader parse .node error? #74

Closed chenweihan closed 6 months ago

chenweihan commented 2 years ago

ERROR Failed to compile with 1 errors

error in ./src/hello/hello.node

Module build failed (from ./node_modules/node-loader/dist/cjs.js): TypeError: this.getOptions is not a function at Object.loader (C:\desk\nest-frontend-desk\node_modules\node-loader\dist\index.js:22:24)

@ ./src/background.js 8:0-39 10:12-17 @ multi ./src/background.js

Hi, I use Electron and Calling the Node file. but I found this bug.

I replace the following code, which used to work fine and I can call functions in Hello. node. //const options = this.getOptions(_options.default); const options = _options.default;

where is getOptions function???

alexander-akait commented 2 years ago

You use webpack v4, you need to use lower version if you need to support webpack v5

alexander-akait commented 6 months ago

Closing due to inactivity. Please test with latest version and feel free to reopen if still regressions. Thanks!