Giter Site home page Giter Site logo

Comments (5)

entranced avatar entranced commented on July 16, 2024

I've started getting the same error recently

from on-finished.

dougwilson avatar dougwilson commented on July 16, 2024

Thank you both. I test this module in CI on almost every Node.js version without issue. If one of you can either provide a fix or provide instructions for how to replicate, thay would help, otherwise I'm not sure what can be done. The request is even in a try catch block too.

from on-finished.

SanGongHappy avatar SanGongHappy commented on July 16, 2024

Thank you both. I test this module in CI on almost every Node.js version without issue. If one of you can either provide a fix or provide instructions for how to replicate, thay would help, otherwise I'm not sure what can be done. The request is even in a try catch block too.

My node version is 16.9.1. I posted the same question on Stackoverflow but didn't receive any responses. The issue is as follows:

warning  in ./node_modules/[email protected]@on-finished/index.js

Module not found: Error: Can't resolve 'async_hooks' in 'D:\project\xy2022\node_modules\[email protected]@on-finished'

 warning  in ./node_modules/[email protected]@raw-body/index.js

Module not found: Error: Can't resolve 'async_hooks' in 'D:\project\xy2022\node_modules\[email protected]@raw-body'

Although it runs normally, it feels awkward. My colleague and I have the same version of Node, but he doesn't get this error on his machine.

Reinstall node, upgrade to the latest version, install async_hooks, and add conditional statements in the two problematic files. There might be some issues with the implementation

function tryRequireAsyncHooks () {
  try {
    return require('async_hooks')
    // return {}
  } catch (e) {
    return {}
  }
}

Both sides of the code have errors in this function. I have a feeling that I haven't used these two plugins in my project. Changing 'return require('async_hooks')' to 'return {}' resolved the error.

from on-finished.

dougwilson avatar dougwilson commented on July 16, 2024

Thank you. Unfortunately that still doesn't explain how to reproduce the error/warning for me to help diagnose. And of course your provided fiz is not possible to accept, as you just... removed the require by commenting it out, meaning it break environments with async_hooks...

from on-finished.

dougwilson avatar dougwilson commented on July 16, 2024

I'm going to close this for now until someone can provide reproduction steps and we can reproduce the issue, particularly as no environment in CI has that error/warning at all, so maybe there is something broken with your environment outside of this module and this module is just revealing the broken environment? Thinking because you said your colleague doesn't have the issue (which is the same as me).

from on-finished.

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.