Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript error when using moduleResolution: node16 #21

Open
aleclarson opened this issue Jan 2, 2025 · 1 comment
Open

TypeScript error when using moduleResolution: node16 #21

aleclarson opened this issue Jan 2, 2025 · 1 comment

Comments

@aleclarson
Copy link

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/[email protected]/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";
@mcollina
Copy link
Collaborator

mcollina commented Jan 2, 2025

Thanks for reporting! Would you like to send a Pull Request to address this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants