Skip to content

dgram.createSocket Fails to execute (missing function) #39

Open
@JeffersonBledsoe

Description

Describe the bug
Node's built-in way of creating a UDP server fails. While importing dgram is allowed, calling dgram.createSocket('udp4'); throws a TypeError. The stack trace is provided below.

Link to the blitz that caused the error
https://stackblitz.com/edit/node-unqbfc?file=index.js

To Reproduce
Steps to reproduce the behavior:

  1. Go to the linked
  2. Run node index.js in the terminal
  3. See error

Expected behavior
The UDP server is created, allowing me to send data over the socket.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS] macOS
  • Browser [e.g. chrome, safari] Chrome
  • Version [e.g. 22] 90

Additional Context

Exception stacktrace

TypeError: s.getAsyncId is not a function
    at new Socket (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:1309655)
    at Object.createSocket (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:1320280)
    at Object.eval (/projects/node-unqbfc/index.js:5:25)
    at Object.function (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:19819)
    at Module._compile (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187549)
    at Object.Module._extensions..js (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187908)
    at Module.load (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:185988)
    at Function.Module._load (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:183564)
    at Function.executeUserEntryPoint [as runMain] (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:794701)
    at Object.a0_0x310c (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:1395336)

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions