-
Notifications
You must be signed in to change notification settings - Fork 942
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
Export typings correctly in package.json #2438
Comments
Looks like this was already noticed a few months ago in #2414. Would it be possible to get a 6.X.Y release containing this fix so we can continue to consume the package while work on v7.0.0 is still ongoing? 😃 |
In the meantime, here's a quick patch if anyone needs it |
This fix should be available in 7.0.0-alpha.1, feedback welcome confirming it is resolved. |
Confirmed using Vite I upgraded from v6, however, and ran into some other snags. I could not find a migration guide, so if it helps others here were the snags:
I am not using Turf very heavily, like maybe 20ish modules, but just wanted to point out those little snags in case it helps anyone (even if it's not related to the Vite fix, which is working great 🙌). |
Spoke too soon...but it might just be something specific to my setup. Vite and my application work just fine during development, but my tests will not run properly for any test that imports a file that uses turf. Example:
What I've triedVery possible I am doing something dumb on my end, but here are my unsuccessful troubleshooting attempts so far:
import { area, center, feature, length, } from '@turf/turf' EnvironmentNot sure if relevant, but:
╰─ yarn -v && node -v && npm -v
1.22.19
v18.7.0
8.15.0
I realize this issue is not Vite-specific, I'm just adding everything for reference. Please let me know what else I can test/change, happy to do so. |
@abettermap I don't have a solution, but just wanted to chime in to confirm I've run into the exact same points you have (e.g. the Running on Node I've tried similar debugging steps as you have - unsuccessful as well unfortunately - and ended up reverting to a patched fork of v6.5.0 because of that. |
@abettermap - thanks so much for this feedback! Turf v7 builds now on top of @types/geojson, as you noticed, you no longer import base types from Turf, rather you import them from @types/geojson and Turf types should be compatible as you've found. From what I can tell the original issue in this ticket has been resolved is that correct? I think the BufferOp issue should be opened as a new issue. Would you be willing to open it? The simplest reproducible example would be helpful. |
Done, but the only way I know to reproduce it is Vite-based, which probably doesn't help you isolate the issue, but maybe MorpheusXAUT's "no vite or similar" comment will shed some light. |
Sorry Tim, I forgot to answer your question. Yes, I believe the issue in the ticket has been resolved. |
See this ticket in TypeScript for discussion:
microsoft/TypeScript#52363
I am having this issue using Turfjs in a project with latest Vite/Typescript/React. It refuses to build because the typings need exporting correctly in package.json when I am building in Vite's "bundler" mode.
The text was updated successfully, but these errors were encountered: