Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

app closes immediately after executing it.  #262

@Siljesc

Description

@Siljesc

It closes too fast before i can see if there's an error. Debugging the pkg process doesn't show anything wrong.

[email protected]
[email protected]

EDIT:
i added this to log any process error

process.on('uncaughtException', function (err) { fs.writeFileSync('log.txt', err); });

and got this:

Error: ENOENT: no such file or directory, uv_chdir

  1. If you want to compile the package/file into executable, please pay attention to compilation warnings and specify a literal in 'require' call. 2) If you don't want to compile the package/file into executable and want to 'require' it from filesystem (likely plugin), specify an absolute path in 'require' call using process.cwd() or process.execPath.

i get this warning when compiling:

Warning Cannot resolve 'process.cwd() + '/config.json''
C:\PATH\app\utils.js
Dynamic require may fail at run time, because the requested file
is unknown at compilation time and not included into executable.
Use a string literal as an argument for 'require', or leave it
as is and specify the resolved file name in 'scripts' option.

I saw on slack someone with the same problem that used the same code to load an external json file.

i tried this one too:
fs.readFileSync(path.join(path.dirname(process.execPath), 'config.json')) and didnt work either. any suggestion?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions