Comments (5)
Adding require("aws-sdk/dist/aws-sdk"); before importing SQLite 3 fixes this for me, although WebPack is still complaining and I imagine I would need to put something in vue.config.js to get it to shut up. This is obviously not an ideal solution, but any thoughts on fixing this weird issue would be wonderful
from vue-cli-plugin-electron-builder.
One more update: After moving the import from a forked process into my main process, I can no longer launch my app. I've described the error in detail here: https://stackoverflow.com/questions/51466585/webpack-fails-to-compile-vue-electron-project-with-sqlite3
from vue-cli-plugin-electron-builder.
This issue appears to be unrelated to my plugin, so I will close it (but continue to help you if I can). I found a question thread that has some information that may be useful to you. Also, check out electron native modules documentation. An alternative would be to use sql.js, which does not use native modules. I tried this and it worked fine.
from vue-cli-plugin-electron-builder.
It's a little late, but I have a fix for you. Set vue.config.js
to:
module.exports = {
pluginOptions: {
electronBuilder: {
chainWebpackRendererProcess: config => {
config.module
.rule('node-loader')
.test(/\.node$/)
.use('node')
.loader('node-loader')
config.resolve.alias.set(
'sqlite3',
'sqlite3/lib/binding/electron-v2.0-YOUR_PLATFORM_HERE-x64/node_sqlite3.node'
)
return config
}
}
}
}
and install node-loader
. Before running serve:electron
, run yarn electron-builder install-app-deps
. You only have to do this in-between installing node_modules
and running serve:electron
.
from vue-cli-plugin-electron-builder.
1.0.0-rc.1 has landed with support for native modules. Upgrade to the latest version of vcp-electron-builder, and re-invoke the generator. Then, sqlite3 should work fine. The generator will not effect any code other than adding the missing requirements for native modules. You can also remove the config I suggested above.
from vue-cli-plugin-electron-builder.
Related Issues (20)
- Unable to Launch Electron App in Development Environment on Specific Computer
- What project to use with Vite? HOT 1
- Unable to build my vue-cli app using vue-cli-plugin-electron-builder 2.1.1
- Any plans to release stable version of vue-cli-plugin-electron-builder 3.0 in near future?
- Unable to modify Heap memory limit
- Can I ask a question,when I use the utilityProcess.fork in main process,what is the param modulePath?Thanks
- Missmatch of dependencies versions between NPM and github HOT 2
- Error: write EPIPE when killElectron
- Why is navigator.bluetooth undefined after packaging? HOT 1
- electron-builder build and install, run with error Cannot read property '_android' of undefined HOT 3
- V-bind() in CSS no longer works when upgrading Electron version
- ERROR: You are using an outdated version of NPM. HOT 1
- Cannot import and use mqtt.js in main process HOT 1
- Socket.io is not working after packing to exe
- Electron does not launch on Raspberry Pi 64-bit (arm64)
- Do not compress the mainBundle during packaging
- Question: How to build a utility process?
- How to enable deep linking?
- Electron Builder does not include dependencies prefixed with "node:" HOT 1
- Incorrect loading of static svg files 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 vue-cli-plugin-electron-builder.