Turf does not work with Webpack 4
See original GitHub issueI upgraded my project to Angular 6 which migrated to Webpack 4. I have a dependency on mapbox
which uses turf. After the upgrade I started getting build errors like the following.
ERROR in ./node_modules/@turf/meta/index.mjs
997:15-25 Can't import the named export 'lineString' from non EcmaScript module (only default export is available)
@ ./node_modules/@turf/meta/index.mjs
@ ./src/index.js
It appears to be failing because @turf/meta
uses mjs
and @turf/helpers
is a non mjs
module. I am not sure if this is just a build configuration in Webpack that needs to be tweaked or if a correction needs to be made to turf. I looked around the Webpack issues and didn’t really see anything to help along with a fix.
Here is a repo to easily reproduce this issue.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:25 (6 by maintainers)
Top Results From Across the Web
Problems importing @turf module in nodeJs - Stack Overflow
So I went to the server using that syntax. I updated @turf/destination from "^6.0. 1" to the latest (6.3....), and I get the...
Read more >Use Mapbox GL JS in a React app | Help
Mapbox GL JS is a JavaScript library used for building web maps. A text editor. Use the text editor of your choice for...
Read more >Grass Clippings, Compost and Mulch: Questions and Answers
Visit our site for our Grass Clippings, Compost and Mulch: Questions and Answers ... Do clippings returned to the lawn contribute to thatch...
Read more >Practical Lawn Establishment and Renovation
for rapid seed germination and grass growth. ... clean, pure grass turf, don't take chances on ... soils are fine to work with...
Read more >Grass Replacement Incentive Program (GRIP) - City of Aurora
Aurora Water incentivizes the conversion of water-guzzling turf lawns to water-wise landscapes through ... Artificial grass does not qualify for a rebate.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Downgrading from @turf/difference v6.0.2 to v6.0.1 worked for me. I deleted my node_modules folder to make sure no old files hung around.
Could we get a similar fix for
@turf/invariant
? Hitting a similar issue when trying to use@turf/boolean-contains