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

app closes immediately after executing it. #262

Closed
Siljesc opened this issue Oct 17, 2017 · 8 comments
Closed

app closes immediately after executing it. #262

Siljesc opened this issue Oct 17, 2017 · 8 comments

Comments

@Siljesc
Copy link

Siljesc commented Oct 17, 2017

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

pkg@4.2.5
node@8.6.0

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?

@lyctw
Copy link

lyctw commented Mar 13, 2019

same problem

@ghost
Copy link

ghost commented Apr 13, 2022

At a company this big, the best they could do Is link to an issue, absolutely ridiculous, they didn't even bother to reply

@ghost
Copy link

ghost commented Apr 13, 2022

The issue still happens, and ive tested it on multiple devices

@ghost
Copy link

ghost commented Apr 13, 2022

after updating, now it doesnt even bother to compile.....

@robertsLando
Copy link
Contributor

@XFaonAE this package is not maintained by Vercel anymore from a long time, it's maintained by outside collaborators in their free time like me @jesec @erossignon. If you find a bug consider opening a PR and fix it, this is what I do when i find one

@ghost
Copy link

ghost commented Apr 14, 2022

Alright, ill see what I can do

@ghost
Copy link

ghost commented Apr 14, 2022

@robertsLando One issue is that it uses CJS instead of ESM, and when I make my other libraries the paths are no[t absolute, they are relative. I cant just convert this entire package to support ESM. I'm not exactly sure what to do

@robertsLando
Copy link
Contributor

I cant just convert this entire package to support ESM. I'm not exactly sure what to do

This is our first priority in TODO list, I know @jesec has something in mind for that but feel free to give a try to it. See discussions on: #1323

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@robertsLando @lyctw @Siljesc and others