Giter Club home page Giter Club logo

Comments (14)

dougwilson avatar dougwilson commented on July 4, 2024 1

Yes, I just didn't want this hanging open indefinitely. I haven't heard anything from you in months, and it's not uncommon for folks to just vanish. I would say that is probably the best next steps: a new issue that includes reproduction steps where I can try to debug through it or a pull request with the fix + tests if you're up for it 👍

from nodejs-depd.

dougwilson avatar dougwilson commented on July 4, 2024 1

Also, I see you mentioned sequelize. I'm not sure if it's causing the issue, but sequelize is using this module incorrectly. See this part of the README:

this module uses the calling file to get the boundary for the call stacks, so you should always create a new deprecate object in each file and not within some central file.

The sequelize module is incorrectly creating a single instance in a centralized file and sharing it across the code base, exactly what can cause issues when that is done.

from nodejs-depd.

dougwilson avatar dougwilson commented on July 4, 2024 1

No problem 👍 I cannot confirm that the incorrect usage is causing your particular issue, but it does cause stack trace-related issues since the frame the instance captured may not contain any of the same frames when the function is later called to display a message. It just sounds like that may be the culprit here, but not sure.

from nodejs-depd.

dougwilson avatar dougwilson commented on July 4, 2024 1

P.S. Sorry for confusing you with OP; I use email for everything here, basically read through email and click through the site to respond; this meant your icon was not next to the text as I was reading it (because I read in my email) and as I scrolled by they had the same colors so I incorrectly assumed it was the same user :D

from nodejs-depd.

arciisine avatar arciisine commented on July 4, 2024

As an addendum, attempting to use NO_DEPRECATION only seems to affect whether or not something is logged, vs whether or not the information is calculated. By allowing NO_DEPRECATION to actually bypass the calculation, that would also work for my use case.

from nodejs-depd.

dougwilson avatar dougwilson commented on July 4, 2024

Weird, I remember some kind of fix along those lines, but not 100% sure. Is the transitive dependency in your tree the most up-to-date version (just to check in case you're mixing any such fix)? As for the NO_DEPRECATION, that's the correct behavior. I think the section on it in the readme does a pretty good job saying it just controls the output to STDERR and nothing else; the events are still emitted on process. If you think the readme can be clarified around that that would be cool to do too.

Yea, if you want to make a PR that would be cool, though if you can provide a repo that reproduces the issue first that I can look at, that would help a lot to get direction on the change prior to spending time working on it 👍

from nodejs-depd.

arciisine avatar arciisine commented on July 4, 2024

Let me get a repro to you, and then we an see if a PR is worthwhile.

from nodejs-depd.

dougwilson avatar dougwilson commented on July 4, 2024

Closing since I never got a reproduction case or a follow up pull request.

from nodejs-depd.

charandas avatar charandas commented on July 4, 2024

@dougwilson this is happening for me when I am using sequelize with jest (ts-jest), with the special case that the wrapping library calling sequelize is using esm.

I basically had to disable my tests couple weeks ago because of this. I may be able to get you the repro.

Basically, once the stack frames become invalid, sequelize using depd for deprecating things makes sequelize un-usable in my tests.

Can I reopen this when I have the repro ready?

from nodejs-depd.

charandas avatar charandas commented on July 4, 2024

Thanks. Just for context, I am not the OP.

This is the line where improper stackframes just make the code fail with cannot get property of undefined, something along those lines.

https://github.com/dougwilson/nodejs-depd/blob/master/index.js#L110

Sure I will open another issue when I am ready.

from nodejs-depd.

charandas avatar charandas commented on July 4, 2024

Ah! I will look into this more deeply. Thank you.

from nodejs-depd.

charandas avatar charandas commented on July 4, 2024

No problem.

I think in my stack, the failure happens when sequelize tries to call the depd constructor itself while newing it.

When you say the function cannot find stack frames, it sounds to me like it's in the later workflow when depd instance is already constructed.

from nodejs-depd.

dougwilson avatar dougwilson commented on July 4, 2024

When you say the function cannot find stack frames, it sounds to me like it's in the later workflow when depd instance is already constructed.

Ah, yes. Is it possible you can open an new issue and we can continue the discussion there? You can paste the exact error with it's stack that is thrown when your code hits that line you linked to to get started.

from nodejs-depd.

charandas avatar charandas commented on July 4, 2024

Yes, will do.

from nodejs-depd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.