-
Notifications
You must be signed in to change notification settings - Fork 50
Cannot set snapshot with ts-node #652
Comments
Thanks for letting us know about this. I suspect what is happening is that Since Our next steps will be to investigate how (if possible) we can access In the meantime, a workaround would be to transpile the typescript to javascript with source-maps. |
Using @geekflyer is there a reason you cannot use transpiled source code? |
Who says that using ts-node in production is not a popular use case? Tbh that's what we do since 2 years with multiple apps and we never encountered any problem with that. In fact it simplifies the build / deploy process quite a lot. The runtime overhead (slightly slower bootstrap) in conjunction with the |
Btw, it is my understanding that ts-node actually creates source-maps on disk in a temporary cache directory. |
@geekflyer my intention wasn't to say that no one deploys that way, or that it is not a valid way to deploy! On the contrary, if you find your self productive with this setup, that's awesome. I do think that this is a feature request and we have to evaluate against our other priorities, and the frequency/popularity of the use-case matters. |
I've investigated this and |
@ofrobots @DominicKramer Would you consider reopening this issue? |
Is this still an issue? Because I am planning to use ts-node in production, because ts-node simplifies the node runtime when using TypeScript. |
As far as I know, this is still an issue, but it may be addressed as a side effect of the work in PR #837. |
I spent hours of try and error and simply can't get cloud debug agent to work with
ts-node
, not even with the simplest of all apps.Below is an extremely simple app to reproduce the issue.
Environment details
@google-cloud/debug-agent
version: 3.0.1 (tried also 2.6.0)Steps to reproduce
Run the following commands to setup a demo project to reproduce the error:
Prerequisites:
gcloud auth application-default login
)Steps:
Prepare reproduction using https://github.com/geekflyer/google-cloud-debugger-bug-repro :
Run code as simple JS app via
PROJECT=<gcp_project> npm run jsapp
and set a watchpoint on the lineconst foo = Math.random();
in filesrc/jsapp.js
and observe that the snapshot gets hit. It works as expected.Run code as typescript app via
PROJECT=<gcp_project> npm run tsapp
and set a watchpoint in the lineconst foo = Math.random();
in filesrc/jsapp.ts
and observe the following ERROR:The app prints:
AND cloud debug never hits the snapshot AND after a while Cloud Debug displays
Could not determine the output file associated with the transpiled input file
.The error message seems similar to #401, however I can consistently reproduce the error and I tried a dozen of other versions / library combinations and couldn't get to work any ts-node based application.
Note I also once included
require('source-map-support/register');
which didn't help either.In short: It seems impossible to use cloud debug with ts-node.
Thanks for fixing in advance!
The text was updated successfully, but these errors were encountered: