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.

Running a built binary fails with weird error

See original GitHub issue

When building the Prisma 2 CLI to a binary with node-packer, I get this weird error:

❯ ./prisma-cli-darwin-2.0.0-alpha.911 version
internal/util.js:206
    throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'original', 'function');
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type function
    at promisify (internal/util.js:206:11)
    at Object.4364 (/__enclose_io_memfs__/build/index.js:2:1368472)
    at __webpack_require__ (/__enclose_io_memfs__/build/index.js:2:154)
    at Object.2740 (/__enclose_io_memfs__/build/index.js:2:706082)
    at __webpack_require__ (/__enclose_io_memfs__/build/index.js:2:154)
    at Object.5575 (/__enclose_io_memfs__/build/index.js:2:1677696)
    at __webpack_require__ (/__enclose_io_memfs__/build/index.js:2:154)
    at Object.729 (/__enclose_io_memfs__/build/index.js:2:142604)
    at __webpack_require__ (/__enclose_io_memfs__/build/index.js:2:154)
    at Object.6292 (/__enclose_io_memfs__/build/index.js:2:1880810)

I’m not quite sure why this happens, but it may have something to do with either 1) Promises (due to the error message) or 2) the file system (due to the fact that these bundlers use a virtual file system); but I’m also not sure if it has to do anything with either of those.

It happens in the latest alpha (tested with 2.0.0-alpha.1000), and I could track it back to 2.0.0-alpha.911, it did not not happen before 2.0.0-alpha.911.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
timsuchanekcommented, Apr 6, 2020

This can now be accomplished with pkg and the following steps:

mkdir build
cd build
yarn init -y
npm i -g pkg
yarn add @prisma/cli@alpha
cd node_modules/@prisma/cli
pkg .
./cli-macos --version
1reaction
pantharshit00commented, May 17, 2020

@adrianoresende Prisma won’t run on frontend. Please make sure you are running Prisma in node

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging a weird 'file not found' error - Julia Evans
Yesterday I ran into a weird error where I ran a program and got the error “file not found” even though the program...
Read more >
Debugging a weird 'file not found' error - Hacker News
I often build static Go binaries and deploy them on a "scratch" base image, which just means there's nothing there but the kernel...
Read more >
trying to load lantern-binary · Issue #614 · ptitSeb/box86 - GitHub
I downloaded 3 library from debian i686 and extracted to folder. now I get this error: BOX86_LOG=1 ./lantern-binary -headless=true Debug level ...
Read more >
Command & binary exists but cannot be executed
I transfered /etc/* files from one Linux server to another and now I have a strange error.
Read more >
My C program fails to run with `cannot execute binary file
I'm trying to compile the below code and execute it, but I get an error. Also running size shows nothing in BS or...
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