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 be imported correctly with TypeScript Node 16 module resolution mode #96

Open
Jack-Works opened this issue Nov 4, 2022 · 5 comments
Assignees

Comments

@Jack-Works
Copy link

TS requires JSBI.default.BigInt instead of JSBI.BigInt

@12wrigja
Copy link
Collaborator

12wrigja commented Nov 4, 2022

Is this similar to js-temporal/temporal-polyfill#177 ?

Are the tsconfig settings mentioned on that issue the relevant ones here?

@12wrigja 12wrigja self-assigned this Nov 4, 2022
@Jack-Works
Copy link
Author

maybe you need an export map and "type": "module" (maybe?) in package.json

@Dr-Nikson
Copy link

The issue is still there for 4.3.0

@12wrigja
Copy link
Collaborator

@Dr-Nikson can you please share your tsconfig settings and the exact error message you see?

@amoshydra
Copy link

amoshydra commented Nov 16, 2024

Issues

facing the same issue in jessealama/decimal128

tsconfig.json jessealama/decimal128@b218eaa47#tsconfig.json

module: NodeNext
moduleResolution: NodeNext

package.json jessealama/decimal128@b218eaa47#package.json

type: module
dependencies.jsbi: ^4.3.0
devDependencies.typescript: ^5.1.3

Scenario 1: Using JSBI as the return type

Cannot use namespace 'JSBI' as a type`

Scenario 2: Creating a BigInt or use any methods

Property 'BigInt' does not exist on type 'typeof import("/../../node_modules/jsbi/jsbi")'

image

Possible resolution

Changing tsconfig to use "moduleResolution": "bundler" solve the issue

-"module": "NodeNext",
+"module": "ES2022",
-"moduleResolution": "NodeNext",
+"moduleResolution": "bundler",

image

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

4 participants