#
#
#
when i use 'npm run dev',the app is ok,but after i npm run build,execute the app only has a blank page.
I find issue in the issues,somebody say the issue is vue-router should set to hash,i try it,but that not works,
can someone tell me the reason,thanks
Hi, @hackboy. Could you give us more context of your problem? An print of page, for example. The print of terminal, too.
same problem, when i execute npm run build:darwin then open the app.
the app is blank :(
There may be some packages use debug
but Uncaught Error: Cannot find module 'debug'
what should i do ?
@hackboy i used electron-builder instead of electron-packager, and then just fine!
@emanuelgsouza I have resolved the problem,the reason is that the npm pack renender failed
Hi @hackboy,
I've got the exact same problem, the app is blank and I have the error Cannot find module 'debug'.
Could you tell me please how you made the npm pack not failed? I'd like to keep using electron-packager if possible.
Also if this can help, I'm using https://github.com/feross/simple-peer and I think it's the package which causes the problem. It uses debug and requires it this way:
var debug = require('debug')('simple-peer')
Then in my app, I've tried importing it in those both ways:
import SimplePeer from 'simple-peer'
const SimplePeer = require('simple-peer')
Both import methods work in dev, but gives the error I have when building the app.
Regards,
M.
Hi @hackboy,
I also have the same problem, but I believe it has more to do with the structure of my project than with the webpack builder process. One thing I did to get around the problem was to pass the full path of the dist directory on line 9 of theapp / src / main / index.js file. Only then I was able to generate the build of my application. I'm still checking, because it only works that way. If I can find a definitive solution, I'll post the solution here. One important note, and I think it is related to my problem, is that I do the build in 32-bit Windows (arggg).
Same problem here, but I fix it by change asar: true to false in config.js. This might be caused by non-pure-js package. I use an OpenCC package which is written in C source with nodejs api, and I need to use electron-rebuilder to make npm run dev work.
If you guys are trying to use native node modules (those written in C), you will most likely have better success with electron-builder as its build process will automatically rebuild those modules against the electron environment. When using electron-packager you will have to manually use electron-rebuild to make sure things are built correctly. This would also explain why these modules only work in development. I'll be adding some documentation about this issue. Please feel free to comment back if you guys have any other questions.
Just wanted to provide a solution I fixed as described in the comments above, I did the following:
vue init simulatedgreg/electron-vue fixed-project-dir
? Application Name fixed-project-dir
? Project description An electron-vue project
? Select which Vue plugins to install vue-electron, vue-resource, vue-router
? Use linting with ESLint? No
? Setup unit testing with Karma + Mocha? No
? Setup end-to-end testing with Spectron + Mocha? No
? What build tool would you like to use? builder
npm install
Then copied my current app to the new app directory. As stated above, it looks like package can't manage whatever I did, which is I assume dependencies. Although builder gives me this line:
No native production dependencies
So I'm unsure what the root cause is. Ran this on both windows and linux.]
Did notice that the paths build and dist in the root are different. the builder put everything in ./dist where as the packager placed things in build
hello,so the problem is work out ?
Most helpful comment
Just wanted to provide a solution I fixed as described in the comments above, I did the following:
Then copied my current app to the new app directory. As stated above, it looks like package can't manage whatever I did, which is I assume dependencies. Although
buildergives me this line:No native production dependenciesSo I'm unsure what the root cause is. Ran this on both windows and linux.]
Did notice that the paths
buildanddistin the root are different. the builder put everything in./distwhere as the packager placed things inbuild