question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Webpack problems with @turf/transformation

See original GitHub issue

More specificially I’m getting this error message:

_turf_transform_translate__WEBPACK_IMPORTED_MODULE_6__.transformTranslate is not a function

The code I’m working with. I know that it works because I was previously using @turf/turf. However, I’m trying to refactor and use just the packages I need.

import * as turf_transformation from '@turf/transformation';
import * as turf_helper from '@turf/helpers';

const point = turf_helper.point([camera.values[1].longitude, camera.values[1].latitude])
const translatedPoly = turf_transformation.transformTranslate(point, 10000, 270);

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
stebogitcommented, Aug 28, 2020

@RaymondDashWu I think it should be

import transformTranslate from '@turf/transform-translate';
1reaction
chrisgervangcommented, Aug 27, 2020

Also I don’t believe “@turf/transformation” is a package on npm, I expect it to be “@turf/transform-translate

https://www.npmjs.com/package/@turf/transform-translate

Read more comments on GitHub >

github_iconTop Results From Across the Web

Turf does not work with Webpack 4 · Issue #1383 - GitHub
I have a dependency on mapbox which uses turf. After the upgrade I started getting build errors like the following. It appears to...
Read more >
@turf/transform-translate | Yarn - Package Manager
@turf/point-to-line-distance​​ Returns the minimum distance between a {@link Point} and a {@link LineString}, being the distance from a line the minimum distance ...
Read more >
Configuring webpack and babel to transform rest arguments in ...
I'm using webpack and babel to compile my JavaScript to ES5. ... It looks like @babel/plugin-transform-parameters should fix the issue, ...
Read more >
Build Performance - webpack
This guide contains some useful tips for improving build/compilation performance. General. The following best practices should help, whether you're running ...
Read more >
Getting started with Turf.js
Turf.js | Advanced geospatial analysis for browsers and Node.js. ... If you're working in Node or with build tool (such as webpack, browserify...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found