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

Impossible to import in TypeScript project #32

Closed
Aareksio opened this issue Jan 27, 2022 · 2 comments
Closed

Impossible to import in TypeScript project #32

Aareksio opened this issue Jan 27, 2022 · 2 comments

Comments

@Aareksio
Copy link

The package is difficult to import from within TypeScript project.

import defu from 'defu'

Throws:

TypeError: (0 , defu_1.default) is not a function

import * as defu from 'defu'
import defu = require('defu')

Works, but fails TypeScript check:

TS2349: This expression is not callable.
Type 'typeof import("X:/my-project/node_modules/.pnpm/defu@5.0.1/node_modules/defu/dist/defu")' has no call signatures.

const defu = require('defu')

Works, no types, using require.

pi0 added a commit that referenced this issue Jan 28, 2022
pi0 added a commit that referenced this issue Jan 28, 2022
@pi0
Copy link
Member

pi0 commented Jan 28, 2022

I added a workaround to defu@5.0.2-alpha. Can you please try it to see if it fixes typescript issue?

@pi0
Copy link
Member

pi0 commented Mar 22, 2022

In v6, you can use import { defu } from defu

@pi0 pi0 closed this as completed Mar 22, 2022
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