Open arturbp opened 3 years ago
I also am using electron-webpack
, and I get the same issue as you but only in dist
mode ("no native build...").
Does your dev mode work?
I just realized my dist
vs. dev
issue was because ref-napi
was installed in devDependencies and not dependencies. This fixed the "no native build..." error.
I just realized my
dist
vs.dev
issue was becauseref-napi
was installed in devDependencies and not dependencies. This fixed the "no native build..." error.
I install ffi-napi in prod dependecies. I'm not using ref-napi with this boilerplate.
Hey,
I had the same issue and found this answer: https://github.com/jsdom/jsdom/issues/2066#issuecomment-401556207
I just installed the mentioned package and added this to my main process webpack config:
webpack.main.config.js:
const nodeExternals = require('webpack-node-externals');
module.exports = {
/**
* This is the main entry point for your application, it's the first file
* that runs in the main process.
*/
entry: './src/index.ts',
// Put your normal webpack config below here
module: {
rules: require('./webpack.rules'),
},
resolve: {
extensions: ['.js', '.ts', '.jsx', '.tsx', '.css', '.json']
},
externals: [nodeExternals()],
// etc configs here
};
This part was new:
externals: [nodeExternals()],
and it worked for me, but I have no idea why... by working I mean the issue is gone, but I did not test the lib yet. Cheers
嘿,
我遇到了同样的问题并找到了这个答案: jsdom/jsdom#2066(评论)
我刚刚安装了提到的包并将其添加到我的主进程 webpack 配置中:
webpack.main.config.js:
const nodeExternals = require('webpack-node-externals'); module.exports = { /** * This is the main entry point for your application, it's the first file * that runs in the main process. */ entry: './src/index.ts', // Put your normal webpack config below here module: { rules: require('./webpack.rules'), }, resolve: { extensions: ['.js', '.ts', '.jsx', '.tsx', '.css', '.json'] }, externals: [nodeExternals()], // etc configs here };
这部分是新的:
externals: [nodeExternals()],
它对我有用,但我不知道为什么......通过工作我的意思是问题消失了,但我还没有测试 lib。 干杯
Thanks for solving my problem
nodeExternals()
这个是main 主进程的打包配置吗?
Getting this error:
index.js:59 Uncaught Error: No native build was found for platform=win32 arch=x64 runtime=electron abi=76 uv=1 libc=glibc node=12.13.0 electron=8.3.4 webpack=true loaded from: C:\
Using this Boilerplate for electronjs
Can u help me?