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

Cannot import correctly under TypeScript Node 16 module resolution #136

Open
Jack-Works opened this issue Apr 19, 2023 · 2 comments
Open

Comments

@Jack-Works
Copy link
Contributor

🐛 Bug Report

Under TypeScript Node 16 module resolution (has type: module in the package.json and moduleResolution: Node16 in tsconfig.json), this package cannot be imported correctly.

image

To Reproduce

import anchorme from 'anchorme'
anchorme.list("")

package.json

{ "type": "module" }

tsconfig.json

{
    "compilerOptions": {
        "moduleResolution": "Node16"
    }
}

Observed behavior

Cannot be imported.

Expected behavior

Imported correctly.

Environment

  • 3.0.4
@alexcorvi
Copy link
Owner

Please check the latest version 3.0.7

@Jack-Works
Copy link
Contributor Author

@alexcorvi thanks for your work! But I'm afraid it's still incorrect:

img
import anchorme from 'anchorme'

console.log(anchorme) // This expression is not callable.
console.log(anchorme.list) // TypeScript error, but works with webpack
console.log(anchorme.default.list) // TypeScript no error, but crashes after webpack

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