InsightSoftwareConsortium / InsightSoftwareConsortium/ITK-Wasm

Issue with package.json "exports" and TypeScript

Open
#567 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
235
Forks
61
Avg merge
4d 19h
Merged PRs (30d)
4

Description

I am unable to use the latest release version of itk-wasm (1.0.0-b.8) with TypeScript 4.6. When compiling and executing my script which imports from itk-wasm, this error is thrown:

`Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /node_modules/itk-wasm/package.json`

I have created a basic example project which reproduces the issue: [itk-wasm-ts-test](https://github.com/ty-ler/itk-wasm-ts-test)

It seems that the "exports" field in package.json is unsupported in versions of TypeScript lower than 4.7 (which is currently just in beta). More discussion on the issue can be found here:
- https://github.com/microsoft/TypeScript/issues/33079
- [TypeScript 4.7 announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7-beta/#package-json-exports-imports-and-self-referencing)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.