Skip to content
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

@turf/bbox import issue turf 6.5.0 #2394

Closed
michaelfaith84 opened this issue Jan 26, 2023 · 2 comments
Closed

@turf/bbox import issue turf 6.5.0 #2394

michaelfaith84 opened this issue Jan 26, 2023 · 2 comments
Labels
bundling Anything related to issues with bundling @turf/bbox

Comments

@michaelfaith84
Copy link

Default import is broken.

As noted with bbox-polygon previously, after importing to use it you must invoke via bbox.default().

@JamesLMilner JamesLMilner changed the title bbox import issue turf 6.5.0 @turf/bbox import issue turf 6.5.0 Jan 26, 2023
@ashley-mort
Copy link

ashley-mort commented Jun 26, 2023

I get a similar problem if I make a custom build (and import with RequireJS). I have to do like turf.area.default instead of turf.area and turf.helpers.polygon instead of turf.polygon.

What am I doing wrong? I don't have this problem using a CDN version like: https://cdn.jsdelivr.net/npm/@turf/turf@6/turf.min.js

All I really wanted was to add and use the rectangle-grid package.

npm install @turf/area @turf/bbox @turf/difference @turf/helpers @turf/meta @turf/rectangle-grid
npm install -g browserify
npm install -g uglify-js
browserify main.js -s turf | uglifyjs > outTurf-min.js
browserify main.js -s turf > outTurf.js

main.js

module.exports = {
    area: require('@turf/area'),
    difference: require('@turf/difference'),
    helpers: require('@turf/helpers'),
    meta: require('@turf/meta'),
    rectangleGrid: require('@turf/rectangle-grid')
};

@smallsaucepan
Copy link
Member

Hi @michaelfaith84 and @ashley-mort, if you can upgrade to v7 this issue should be fixed for you. If you need to stick with v6, keep an eye on #2600 where we're aiming to retro-fix typing issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bundling Anything related to issues with bundling @turf/bbox
Projects
None yet
Development

No branches or pull requests

3 participants