-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compatibility with Node.js' source-map implementation #39
Comments
Absolutely! Please forgive me, as I have never used any kind of transform thing, though I am aware of their existence. Just reading the docs nothing jumps out to me on what to write here. Is it possible to provide some kind of example app I can play with? Like something where the stack trace would be incorrect unless run with the enable stack traces? |
@dougwilson yeah, I'd me than happy to provide you something; I'll start drafting up a testing repo tonight. What we need to be mindful of, is a lot of folks might already be using express and source-map-support in conjunction; both of which override Perhaps we can pick @LinusU's brain too, for some requirements. |
Here's a minimal express + TypeScript app which demonstrates some of the challenges facing a TypeScript application, related to introspecting errors. Interestingly, source-map-support does seem to work in conjunction with What I'd love would be for us to figure out a way to make |
Thank you, but I'm not sure you are using this module correctly. You cannot create the deprecation function and use it again in the same file. Running your code I'm not seeing a deprecation message from this module, but maybe I'm not calling it the right way. Can you tell me the steps to see the deprecation message from here? Maybe paste in a screenshot here of the message you see and point out where the message is incorrect and what a correct one would look like? Remember, I have never used typescript or any other transpiled language in node.js so don't have the same background as you may have to just "know" what to do here :) |
I have also never used winston or bunyon myself, so again, do not know what it would mean to step on their toes... and specifics you can provide would help move this forward. I'm still lost on what, exactly, I need to do here, sorry :( |
If you
In the logs. I suppose the larger goal I'm suggesting is separate from Without breaking express, I would like us to be able to run:
And receive a stack trace that includes the correct original source position, like this:
I only brought up winston and bunyan because we don't want to interfere with their own modifications to stack trace behavior. |
So because it is express that is calling the deprecation, the message seems to be right, right? Is there is something wrong with the deprecation message you out above? The stack trace question does not seem related to this module, unless you can show where this module is making said stack trace you are seeing? It should likely belong in a meta issue somewhere vs in this issue tracker unless it is something this module could affect? |
In the example, the stack trace you are pointing to you created with |
@dougwilson the root of the problem I'm trying to figure out a solution for, is that if a library like There is however an API available, such that an implementor could perform the source-map lookup themselves, from Node.js' internal cache: const sm = findSourceMap(t.getFileName(), error); It would be nice to figure out a way for someone to have both useable stack traces when working in a transpiled language like TypeScript, and to have this deprecation functionality. |
Sure, but this module only overrides |
Maybe if I provide my console output from your repo, you can see why I'm confused. Here is the output from
Yes, that does not include the
I see the stack trace as it seems you want it to be seen... I'm just lost at what, exactly, I'm missing here? I'm happy work to to fix something, but I am just at a total loss of what I'm supposed to be seeing that is wrong? |
@dougwilson I apologize for the confusion, this is working for me for the latest Node 13 too; I wasn't following that you set aside the original This is great news, sorry for wasting your time. |
Hey @dougwilson, I was wondering if you'd be willing to work with me to figure out a way to make this compatible with Node.js' source-map support, we just landed an API for this here:
nodejs/node@521b222
What I'd love would be to have a well defined way that we can expose transpiled stack traces to express users.
The text was updated successfully, but these errors were encountered: