You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "andrew0 (via GitHub)" <gi...@apache.org> on 2023/12/19 05:53:30 UTC
[I] TypeScript types don't work with Node ESM [arrow]
andrew0 opened a new issue, #39289:
URL: https://github.com/apache/arrow/issues/39289
### Describe the bug, including details regarding any error messages, version, and platform.
The `apache-arrow` package has an `exports` field that points to an ESM build for Node.js imports, which works at runtime, but I get an error from TypeScript saying that it can't find the types for ESM projects:
<img width="590" alt="image" src="https://github.com/apache/arrow/assets/739172/564e69cb-c379-4a61-8f41-5bf0c1f42344">
https://stackblitz.com/edit/stackblitz-starters-7u3tyj?file=src%2Findex.ts
If I modify the `exports` field to this:
```
"exports": {
".": {
"node": {
"types": "./Arrow.node.d.ts",
"import": "./Arrow.node.mjs",
"require": "./Arrow.node.js"
},
"types": "./Arrow.dom.d.ts",
"import": "./Arrow.dom.mjs",
"require": "./Arrow.dom.js"
},
"./*": {
"import": "./*.mjs",
"require": "./*.js"
}
}
```
then TypeScript is able to find the types correctly.
### Component(s)
JavaScript
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [JS] TypeScript types don't work with Node ESM [arrow]
Posted by "domoritz (via GitHub)" <gi...@apache.org>.
domoritz closed issue #39289: [JS] TypeScript types don't work with Node ESM
URL: https://github.com/apache/arrow/issues/39289
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] TypeScript types don't work with Node ESM [arrow]
Posted by "ixxie (via GitHub)" <gi...@apache.org>.
ixxie commented on issue #39289:
URL: https://github.com/apache/arrow/issues/39289#issuecomment-1872469494
Running into this as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [JS] TypeScript types don't work with Node ESM [arrow]
Posted by "domoritz (via GitHub)" <gi...@apache.org>.
domoritz commented on issue #39289:
URL: https://github.com/apache/arrow/issues/39289#issuecomment-1879054745
Can you try https://github.com/apache/arrow/pull/39475?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org