0x: Failing with JSON parse error

The program I’m trying to profile is a node script, normally I run it like

botpress start

Or more specifically in this case

"start": "NODE_ENV=production LOG_LEVEL=info DATABASE=postgres DATABASE_URL=postgres://x:y@localhost:5432/z node ./node_modules/.bin/botpress start"

Which works.

I am also able to manually gather the profiling info by running

"start-perf": "rm -f isolate* && NODE_ENV=production LOG_LEVEL=info DATABASE=postgres DATABASE_URL=postgres://x:y@localhost:5432/z node --prof ./node_modules/.bin/botpress start"

My 0x command correspondingly looks like

"start-0x": "NODE_ENV=production LOG_LEVEL=info DATABASE=postgres DATABASE_URL=postgres://x:y@localhost:5432/z 0x -- node ./node_modules/.bin/botpress start"

And I’m getting

🔥  ProfilingSyntaxError: Unexpected token : in JSON at position 2
    at JSON.parse (<anonymous>)
    at Pipe.channel.onread (internal/child_process.js:470:28)

Any idea why? I’m not seeing the detailed stack so I’m not even sure if it’s coming from 0x itself or from my program being ran in some unusual way (and thus maybe not being able to find some JSON file by relative path?)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (4 by maintainers)

Most upvoted comments

Sorry for the long delay, yes please share it!