Skip to content

TypeScript error when using moduleResolution: node16 #21

@aleclarson

Description

@aleclarson

Trying to construct a Valkey instance like so:

import Valkey from 'iovalkey'

const valkey = new Valkey({})

…gives the following TypeScript error:

This expression is not constructable.
  Type 'typeof import("/path/to/my-project/node_modules/.pnpm/iovalkey@0.2.1/node_modules/iovalkey/built/index")' has no construct signatures.ts(2351)

The issue is caused by a lack of .js extensions in the .d.ts files:

export { default } from "./Redis";
// should be:
export { default } from "./Redis.js";

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