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.

Reference to absoulte path in resulting .exe file -> unable to run on different system

See original GitHub issue

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Clone https://github.com/digaus/capacitor-plugin-demo
  2. run npm install
  3. run npm run build -- --prod
  4. run npx cap sync @capacitor-community/electron
  5. run npm run electron:build-windows inside electron folder
  6. Install .exe on a different System
  7. Start .exe via Command Line Tool to see error

Following error occurs:

(node:12460) UnhandledPromiseRejectionWarning: Error: Cannot find module 'C:\Users\User\Documents\Git\capacitor-plugin-demo\electron\node_modules\@digaus\file-server\electron\dist\plugin.js'
Require stack:
- C:\Users\digau\AppData\Local\Programs\capacitor-plugin-demo\resources\app.asar\node_modules\@capacitor-community\electron\dist\runtime\electron-plugins.js
- C:\Users\digau\AppData\Local\Programs\capacitor-plugin-demo\resources\app.asar\node_modules\@capacitor-community\electron\dist\core\util.js
- C:\Users\digau\AppData\Local\Programs\capacitor-plugin-demo\resources\app.asar\node_modules\@capacitor-community\electron\dist\core\index.js
- C:\Users\digau\AppData\Local\Programs\capacitor-plugin-demo\resources\app.asar\build\src\index.js
-
    at Module._resolveFilename (internal/modules/cjs/loader.js:887:15)
    at Function.n._resolveFilename (electron/js2c/browser_init.js:257:1128)
    at Module._load (internal/modules/cjs/loader.js:732:27)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (C:\Users\digau\AppData\Local\Programs\capacitor-plugin-demo\resources\app.asar\node_modules\@capacitor-community\electron\dist\runtime\electron-plugins.js:2:26)
    at Module._compile (internal/modules/cjs/loader.js:1078:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10)
    at Module.load (internal/modules/cjs/loader.js:935:32)
(Use `Capacitor App --trace-warnings ...` to show where the warning was created)
(node:12460) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:12460) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Expected behavior App should run normally and not reference an absolute path.

Desktop (please complete the following information):

  • OS: Windows 10

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
IT-MikeScommented, Aug 26, 2021

Submitted a PR to your repo

1reaction
IT-MikeScommented, Oct 20, 2021

Issue fixed in #151 by @jdgjsag67251 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

11 Ways to Fix "The System Cannot Find The Path Specified ...
1. Run Command Prompt as an Administrator · 2. Ensure the File Isn't Password Protected · 3. Check Your System for Viruses ·...
Read more >
pyinstaller exe identifiies relative paths but not absolute path
To create Exe I run cmd commands from Exe directory. pyinstaller -F -i ABC.ico "..\src\scriptabc.py". The resulting files are correctly ...
Read more >
File path formats on Windows systems | Microsoft Learn
An absolute file path from the root of drive C: . \Program Files\Custom Utilities\StringFinder.exe, A relative path from the root of the current ......
Read more >
Issues When Using auto-py-to-exe - Nitratine
After helping many of people fix issues with auto-py-to-exe and ... The file cannot be accessed by the system; The exe Runs But...
Read more >
Relative and absolute paths, in the file system and on the web ...
Both web-server and file system are doing that but different ways. ... And if you try to use it in PHP it will...
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