Open AiHaibara opened 1 month ago
Customizing Protection Or https://github.com/alex8088/electron-conf (Recommand)
Customizing Protection Or https://github.com/alex8088/electron-conf (Recommand)
In the future, this 'esm' kind or 'arrow inside class property' packages may become more and more, will it support more convenient methods?
and for rimraf 6.0.1 plugins: [externalizeDepsPlugin()] want to ask a question
do you know why running the exe and the error is like this?
it will show when running the exe Uncaught Exception: TypeError: Class extends value undefined is not a constructor or null at Object.
Is it also caused by esm?, even the error he reported is not esm
if i using manualChunks for process bytecodePlugin and if my child process using mime 4.0.4 I need to write like this
if(id.includes('mime')){
return 'xxx';
}
otherwise it will exit the child process, i don't know why, just add this comment as a mark
{
plugins: [externalizeDepsPlugin({exclude:['rimraf','mime']}),bytecodePlugin({chunkAlias:['index']})],
build: {
rollupOptions: {
input: {
index: resolve(__dirname, 'src/main/index.ts'),
child: resolve(__dirname, 'src/main/child.ts')
},
output: {
manualChunks(id){
if(id.includes('mime')){
return 'xxx';
}
if(id.includes('node_modules')){
return 'vendor'
}
}
}
}
}
}
Describe the bug
pnpm create @quick-start/electron testrimraf --template vue ✔ Add TypeScript? … Yes ✔ Add Electron updater plugin? … Yes ✔ Enable Electron download mirror proxy? … Yes add these lines in main/index.ts bottom
rimraf 6.0.1
latestplugins: [externalizeDepsPlugin(),bytecodePlugin()]
it will show when running the exeUncaught Exception: TypeError: Class extends value undefined is not a constructor or null at Object.<anonymous> (/Users/xxx/code/projects/app/testrimraf/dist/mac-arm64/testrimraf.app/Contents/Resources/app.asar/node_modules/path-scurry/dist/commonjs/index.js:124:40)
and if usingplugins: [externalizeDepsPlugin({exclude:['rimraf']}),bytecodePlugin()]
it will show when pnpm run build[vite:bytecode] unknown file: Unable to transform arrow inside class property
and it's working for run dev
pnpm create @quick-start/electron testelectronstore --template vue ✔ Add TypeScript? … Yes ✔ Add Electron updater plugin? … Yes ✔ Enable Electron download mirror proxy? … Yes add these lines in main/index.ts bottom
electron-store 10.0.0
latestplugins: [externalizeDepsPlugin(),bytecodePlugin()]
it will show when running the exe or run devError [ERR_REQUIRE_ESM]: require() of ES Module /Users/xxx/code/projects/app/testelectronstore/node_modules/.pnpm/electron-store@10.0.0/node_modules/electron-store/index.js from /Users/xxx/code/projects/app/testelectronstore/out/main/index.js not supported.
and my project can't using type:module for other codes, here just for the demo case. but if usingplugins: [externalizeDepsPlugin({exclude:['electron-store']}),bytecodePlugin()]
it will show when pnpm run build[vite:bytecode] unknown file: Unable to transform arrow inside class property
Electron-Vite Version
2.3.0
Electron Version
31.0.2
Vite Version
5.3.1
Validations