Comments (3)
我看过这个,但现在这个框架里已把所有的dependencies都包含到了external中,
rollupOptions: {
external: Object.keys('dependencies' in pkg ? pkg.dependencies : {}),
},
我创建了一个最小实现,地址是:https://github.com/l1985q/vite-sqlite3-test.git
我的环境是windows10,vs 2022的C++编译工具包、python3.11
初次安装完better-sqlite3,按官方的文档使用electron-rebuild重新编译,执行npm run dev能正常操作数据库。
使用npm run build打包时electron-builder会重新进行编译操作,打包出来的程序执行闪退,better-sqlite3没有正常工作。
这时再重新执行npm run dev 也是一样的闪退,再执行一次electron-rebuild依然不能修复。只有重新npm uninstall better-sqlite3再安装、编译才能正常run dev。
from electron-vite-react.
你可以看看这个?https://electron-vite.github.io/guide/cpp-addons.html#example
您最好提供一个最小复现,我好能尝试分析问题,谢谢。
from electron-vite-react.
你看看这两个 Demo
https://github.com/caoxiemeihao/electron-vite-samples/tree/main/better-sqlite3-main-process
https://github.com/caoxiemeihao/electron-vite-samples/tree/main/better-sqlite3-renderer-process
from electron-vite-react.
Related Issues (20)
- Running multiple instances on the background HOT 4
- BrowserWindow.loadfile not seeing route HOT 1
- [dev] `tailwindcss --watch && vite` will block running on Windows HOT 1
- [BUG] Some WASMs are failed to obtain HOT 1
- [BUG] No response after running, application does not pop up
- in linux unbuntu 20: equestError: socket hang up │ at ClientRequest. HOT 1
- How to use `utilityProcess` in this template? HOT 3
- pakage.json 中 react 置于 devDependencies 的疑问
- 当 contextIsolation: true, nodeIntegration: false 时,控制台报错 HOT 1
- 如何引入sqlite3 HOT 1
- 麻烦 升级下 package.json 里的包 , 谢谢 HOT 1
- 我有2个屏幕, 屏幕1 写代码, 屏幕2 放 app预览窗口,每次修改 主进程代码 后, 新生成的app 都会出现在屏幕1,并且会把焦点给切过去 HOT 2
- 提交到 awesome-electrion HOT 1
- Unable to use koa packages HOT 5
- Run npm run dev under wayland with wayland flags HOT 2
- 构建Windows客户端后打开wouter显示空白,且没有任何报错,但在开发环境下运行正常,wouter是一个类似react-router的路由框架 HOT 1
- Unable to build HOT 4
- [Help] @react-pdf_renderer bug HOT 2
- [Help] Failed preload + window.ipcRenderer is undefined HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from electron-vite-react.