question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No such file or directory build\checkin.proto

See original GitHub issue

Hi,

I’m using electron-push-receiver version 2.0.0. When I use ipcRenderer.send(START_NOTIFICATION_SERVICE, senderId); in my renderer process, there is an error in my console window says that; PUSH_RECEIVER:::Error while starting the service { Error: ENOENT: no such file or directory, open '<my path>\build\checkin.proto'

What wrong have I done ?

Thank you,

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hieu-htcommented, Jul 7, 2022

For someone struggling when integrating this awesome package with your electron project is built with vue-cli-plugin-electron-builder, you need to use a custom webpack config build of the main process, not renderer process, this is vue-cli-plugin-electron-builder docs about that. You need to custom build config with chainWebpackMainProcess Here is my configuration at vue.config.js:

const { defineConfig } = require("@vue/cli-service");
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");

module.exports = defineConfig({
  transpileDependencies: true,
  pluginOptions: {
    electronBuilder: {
      preload: "src/preload.ts",
      builderOptions: {
        appId: "...",
        publish: [
          {
            provider: "generic",
            url: "http://127.0.0.1:3005/",
          },
        ],
        mac: {
          category: "public.app-category.business",
          target: ["zip", "dmg"],
        },
        nsis: {
          oneClick: true,
          perMachine: false,
          runAfterFinish: true,
          allowElevation: true,
          deleteAppDataOnUninstall: true,
          menuCategory: true,
        },
        win: {
          target: [
            {
              target: "nsis",
              arch: ["x64"],
            },
          ],
          publisherName: "...",
          legalTrademarks: "...",
          verifyUpdateCodeSignature: false,
        },
      },
      /**
       * work around to fix this issue: https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/1647#issuecomment-1019400838
       * some resources is defined by url in css file can't be loaded on production build (urls start with app:///)
       * docs of package related to this issue: https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/configuration.html#changing-the-file-loading-protocol
       * */
      customFileProtocol: "./",
      externals: ["chokidar"],
      chainWebpackMainProcess: (config) => {
        // Chain webpack config for electron main process only
        config.plugin("copy").use(CopyWebpackPlugin, [
          {
            patterns: [
              {
                from: "node_modules/push-receiver/src/mcs.proto",
                to: "mcs.proto",
              },
              {
                from: "node_modules/push-receiver/src/gcm/android_checkin.proto",
                to: "android_checkin.proto",
              },
              {
                from: "node_modules/push-receiver/src/gcm/checkin.proto",
                to: "checkin.proto",
              },
            ],
          },
        ]);
      },
    },
  },
  css: {
    loaderOptions: {
      scss: {
        additionalData: `@import "@/assets/css/variables.scss";`,
      },
    },
  },
  configureWebpack: {
    // Webpack's configuration applied to web builds and the electron renderer process
    plugins: [
      new NodePolyfillPlugin(),
    ],
  },
});
0reactions
pragatijadhavcommented, Feb 18, 2021

I have used copy-webpack-plugin, facing the same issue after generating an executable with electron-builder. Below is the code from my webpack file.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Proto Compilation Error - No such file or directory
I am trying to compile Protoc library but It just keeps giving me the error of No Such Directory even though it is...
Read more >
include/uapi/linux/bpf.h - platform/external/libbpf
Then, if verifier is not doing correct analysis, such randomization will. * regress tests to expose bugs. ... *README* file under the same...
Read more >
Tk Source Code: Timeline
We are no longer on CVS, so don't need the .cvsignore files any more check-in: ... as this prevented interaction with native widgets...
Read more >
include/uapi/linux/bpf.h
If no other file descriptors or filesystem nodes refer to the * same object, it will be deallocated (see NOTES). * * The...
Read more >
Viewing online file analysis results for 'cb.exe'
Not all malicious and suspicious indicators are displayed. ... Touches files in the Windows directory ... Dropping %s traffic on proto %s [%u.%u.%u....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found