Comments (9)
The issue was that the resolve extensions didn't contain '.js'
. This is fixed and you can switch back to the beta with version 1.0.0-beta.6
when it comes out.
from vue-cli-plugin-electron-builder.
Beta.6 has just been released, you can use that now!
from vue-cli-plugin-electron-builder.
@beeing Try this:
// vue.config.js on the root of the project
module.exports = {
chainWebpack: config => {
config.resolve.extensions.add('.json')
}
}
from vue-cli-plugin-electron-builder.
After some research, it looks like the issue come from the webpack configuration. I came across multiple SO/GitHub issues talking about editing resolve#extensions
from webpack config.
This one for example, which is exactly the same error as I have.
EDIT: after tweaking the webpack config file and changing the orders of resolve extensions, it still doesn't work.
// vue.config.js on the root of the project
module.exports = {
chainWebpack: config => {
config.resolve.extensions
.clear()
.add('.ts')
.add('.tsx')
.add('.js')
.add('.vue')
.add('.json')
}
}
EDIT 2: I have tried so much things but nothing is working:
- Tweaking the webpack config with
vue.config.js
(passing config withconfigureWebpack
orpluginOptions#electronBuilder
) and following advices from here. rm -rf ./node_modules
and regen it with yarn (and repeat with npm).- Tweaking the
tsconfig.json
:jsx
,module/target
,baseUrl
,include/exclude
,moduleResolution
,sourceMap
. vue inspect > vue.wp.js
and checking the default config.- Manually inspect what's going on in
node_modules/axios
, but everything seems fine here.
At this point, I'm out of ideas and don't know what to do. This is very blocking for my project and I can't do anything.
EDIT 3: I tried to downgrade vcp-electron-builder to 0.3.2 and re-invoke it. Everything seems to work well so there is something definitely wrong with beta versions IMO. By default it generates an Electron main process file in .js
, I switched it to a .ts
.
Link to the branch of my repo with [email protected].
EDIT 4: It happened again while I was exporting 2 interfaces and a function from a file into an index.ts
. It worked well until I added the 2 interfaces into the index.ts
. The issue seems to be that it can't resolve indexes files that have more than 1 exported value. I have not tested a lot of things about it.
from vue-cli-plugin-electron-builder.
👍 Would love eyes on this
from vue-cli-plugin-electron-builder.
Thanks for the fix @nklayman, any ETA for the 1.0.0-beta.6
?
from vue-cli-plugin-electron-builder.
It will be released within a few days. If you want to use it now, just set the version of vcp-electron-builder to nklayman/vue-cli-plugin-electron-builder
to use the github repo instead of published version.
from vue-cli-plugin-electron-builder.
Works fine, it can now resolve .js
index files from node_modules
.
from vue-cli-plugin-electron-builder.
Hi, I'm experiencing similar issue but for .json file which from a npm module called spinnies
. Is there any workaround for this?
Thanks in advance.
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.