Skip to content

Node 18 family parameter fails when passing url #1672

Closed

Description

@ksmithut

The following example fails in node 18

import Redis from 'ioredis'

new Redis('redis://localhost:6379?family=6')
[ioredis] Unhandled error event: TypeError [ERR_INVALID_ARG_VALUE]: The property 'options.family' must be one of: 0, 4, 6. Received '6'
    at lookup (node:dns:179:11)
    at node:net:1170:5
    at defaultTriggerAsyncIdScope (node:internal/async_hooks:466:18)
    at lookupAndConnect (node:net:1169:3)
    at Socket.connect (node:net:1097:5)
    at Object.connect (node:net:219:17)
    at .../node_modules/ioredis/built/connectors/StandaloneConnector.js:58:45
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

This is because node 18 stopped type coercing the family value. nodejs/node#41431

I'll attempt to submit a PR for this.

Activity

  1. ksmithut commented on Nov 2, 2022

    @ksmithut
    ContributorAuthor

    PR submitted: #1673

  2. ksmithut commented on Nov 2, 2022

    @ksmithut
    ContributorAuthor

    @luin Thanks for the quick turnaround 🍺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions