Hi,
Since 5.0 update, using import turf from '@turf/turf' doesn't work. Says it's undefined.
OK so after 5.0 it works as import * as turf from '@turf/turf'
Thanks for that @IgorVanian , I'll add something to our docs. Currently the docs are geared towards using turf via the old built version however it would be nice to make it a bit more obvious how to use it via ES6.
馃憤 Thanks for the heads up, I think this can be solved via documenation, unfortunately we won't be supporting mixing named and default exports since it's not recommended by Rollup to do such a thing.
We will leave this issue opened until the docs are updated 馃槈
I am getting a turf undefined error in the browser when doing import * as turf from @turf/turf or import '@turf/turf while using web pack. Any ideas?
Hi @gorbypark
Sorry for not replying earlier, did you ever get this sorted - Im just doing an update on the docs now...
I can confirm that import turf from '@turf/turf' returns undefined, whilst import * as turf from '@turf/turf' does the trick.
Correct, import * as turf from '@turf/turf' should be the correct way to import the module.
v5.0+ Turf releases is using Namespace Imports and Default exports for most TurfJS modules.
A good read about Namespace Imports: https://medium.com/@timoxley/named-exports-as-the-default-export-api-670b1b554f65
Most helpful comment
OK so after 5.0 it works as
import * as turf from '@turf/turf'