Describe the bug
When you execute a binary (e.g. via execa.sync
) the process crashes and a SyntaxError is output to stderr
.
❯ node repro.js
Error: Command failed with exit code 1: /projects/node-psqsqe/node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x
SyntaxError: Invalid or unexpected token
at __global_eval__ (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:8:15954)
at _0x18a892 (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:21075)
at _0x372288.runInThisContext (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:20268)
at _0x2e8059 (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:19362)
at wrapSafe (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:186554)
at Module._compile (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187186)
at Object.Module._extensions..js (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187908)
at Module.load (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:185988)
at Function.Module._load (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:183564)
at Function.executeUserEntryPoint [as runMain] (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:794701)
at makeError (/projects/node-psqsqe/node_modules/execa/lib/error.js:59:11)
at Function.module.exports.sync (/projects/node-psqsqe/node_modules/execa/index.js:186:17)
at Object.eval (/projects/node-psqsqe/repro.js:21:26)
at Object.function (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:19819)
at Module._compile (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187549)
at Object.Module._extensions..js (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187908)
at Module.load (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:185988)
at Function.Module._load (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:183564)
at Function.executeUserEntryPoint [as runMain] (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:794701)
at Object.a0_0x310c (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:1395336) {
shortMessage: 'Command failed with exit code 1: /projects/node-psqsqe/node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x',
command: '/projects/node-psqsqe/node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x',
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: '',
stderr: 'SyntaxError: Invalid or unexpected token\n' +
' at __global_eval__ (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:8:15954)\n' +
' at _0x18a892 (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:21075)\n' +
' at _0x372288.runInThisContext (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:20268)\n' +
' at _0x2e8059 (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:19362)\n' +
' at wrapSafe (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:186554)\n' +
' at Module._compile (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187186)\n' +
' at Object.Module._extensions..js (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187908)\n' +
' at Module.load (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:185988)\n' +
' at Function.Module._load (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:183564)\n' +
' at Function.executeUserEntryPoint [as runMain] (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:794701)',
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
Looks to me as the binary never really is executed but something fails earlier.
Link to the blitz that caused the error
https://stackblitz.com/edit/node-ktsmgm?file=repro.js
To Reproduce
Steps to reproduce the behavior:
- Go to the blitz
- Run
node repro.js
- Observe the error
You can observe similar behavior by running e.g. npx prisma -v
.
Expected behavior
The binary can be executed and e.g. data is returned.
Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2
Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.93
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
performance.memory = {
totalJSHeapSize: 87445835,
usedJSHeapSize: 83184883,
jsHeapSizeLimit: 4294705152
}
Additional context
The blitz uses prisma
to have a binary to execute, repro.js
then is a minimal version/variant of the code the Prisma CLI itself would also run. If for some reason no dependencies are installed, npm install
is not enough, also run npx prisma
, npx prisma -v
and npx prisma format
once to trigger the on demand download of said binary.