Closed RaimisJ closed 6 years ago
The problem is with webpack - it does not copy .proto files and also when UglyfyJS is applied somehow the code stops working.
Hey @RaimisJ, how to fix this?
Thanks.
In my case, this problem entirely depended on my configuration:
Thanks @RaimisJ
I'm also encountering this problem, however my .proto
files are properly copied to my build dir.
It works perfectly when compiled with webpack
, it however fails with the same error mentioned above when packing the code with electron-builder
. Any ideas?
@RaimisJ what is targetPath
in your config? The output folder of webpack?
@ream88 in the end, I ended up using not bundled node_modules folders. Only then it works correctly in all cases.
@RaimisJ Yeah, not using webpack and bundling the files helped! However now I need more and more features provided via webpack like for example its DefineWebpack plugin, and I'm stuck again 😞
@ream88 I think you have the issue as #32
process.env.NODE_ENV = process.env.NODE_ENV || "production"
const CleanWebpackPlugin = require("clean-webpack-plugin")
const CopyWebpackPlugin = require("copy-webpack-plugin")
module.exports = {
module: {
rules: [
{
test: /\.(m?js|node)$/,
parser: {amd: false},
use: {
loader: "@zeit/webpack-asset-relocator-loader",
options: {
outputAssetBase: "build",
},
},
},
{
test: /\.js$/,
exclude: /node_modules/,
use: "babel-loader",
},
],
},
entry: "./main.js",
plugins: [
new CleanWebpackPlugin(["dist", "build"]),
new CopyWebpackPlugin([
{from: "node_modules/push-receiver/src/mcs.proto", to: "build"},
{from: "node_modules/push-receiver/src/gcm/android_checkin.proto", to: "build"},
{from: "node_modules/push-receiver/src/gcm/checkin.proto", to: "build"},
]),
],
output: {
path: __dirname,
filename: "main-packaged.js",
},
node: {
__dirname: false,
__filename: false,
},
target: "electron-main",
mode: "production",
stats: {
colors: true,
children: false,
chunks: false,
modules: false,
},
}
This works for me
Hi,
Works as expected in development. However, if I package it using electron-packager, I get this error (on ipcRenderer.send(START_NOTIFICATION_SERVICE, 'correct id'))
Register request has failed with Error=PHONE_REGISTRATION_ERROR Retry... 1 <retries 5 times, then> Register request has failed with Error=PHONE_REGISTRATION_ERROR PUSH_RECEIVER:::Error while starting the service Error: GCM register has failed
What could be the problem?