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

fix: add named export to support ESM imports in Typescript #1695

Merged
merged 1 commit into from
Jan 14, 2023

Conversation

SCG82
Copy link
Contributor

@SCG82 SCG82 commented Dec 24, 2022

Currently getting a "has no construct signatures" error with the following in Typescript 4.9.4, Node 18.12.1, type: module, module: node16, moduleResolution: node16:

import Redis from 'ioredis'

const redis = new Redis()

Changing the ioredis package with this change allows:

import { Redis } from 'ioredis'

const redis = new Redis()

without any error, and with full type information.

@SCG82 SCG82 changed the title Named export to support ESM imports in Typescript fix: add named export to support ESM imports in Typescript Dec 24, 2022
@danielgormly
Copy link

Also facing this issue with
Typescript 4.9.4
Node 18.12.1

tsconfig.json:
"target": "ES2020"
"module": "ES2020"
"moduleResolution": "nodenext"

@luin luin merged commit cdded57 into redis:main Jan 14, 2023
github-actions bot pushed a commit that referenced this pull request Jan 14, 2023
## [5.2.5](v5.2.4...v5.2.5) (2023-01-14)

### Bug Fixes

* Named export to support ESM imports in Typescript ([#1695](#1695)) ([cdded57](cdded57))
@github-actions
Copy link

🎉 This PR is included in version 5.2.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

luin pushed a commit that referenced this pull request Apr 15, 2023
## [5.2.5](v5.2.4...v5.2.5) (2023-01-14)

### Bug Fixes

* Named export to support ESM imports in Typescript ([#1695](#1695)) ([cdded57](cdded57))
janus-dev87 added a commit to janus-dev87/ioredis-work that referenced this pull request Mar 1, 2024
## [5.2.5](redis/ioredis@v5.2.4...v5.2.5) (2023-01-14)

### Bug Fixes

* Named export to support ESM imports in Typescript ([#1695](redis/ioredis#1695)) ([cdded57](redis/ioredis@cdded57))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants