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

ogr2ogr is not a function #90

Closed
bertday opened this issue Nov 21, 2022 · 1 comment
Closed

ogr2ogr is not a function #90

bertday opened this issue Nov 21, 2022 · 1 comment

Comments

@bertday
Copy link
Contributor

bertday commented Nov 21, 2022

Thank you for this awesome tool! I'm excited to use it in my geodata wrangling :)

I tried following the instructions in README.md and got an error:

Uncaught TypeError TypeError: ogr2ogr is not a function

Here is my code:

import ogr2ogr from 'ogr2ogr';

(async () => {
  const { data } = await ogr2ogr('/path/to/a.shp');
  console.log(data);
})();

and indeed when I console.log(ogr2ogr) I get an object:

{default: ƒ, __esModule: true}

The following works, if I access that default property by name:

const { data } = await ogr2ogr.default('/path/to/data');

Also, I made sure my package.json has the old "type": "module" to enable ES6 imports.

Is there anything I'm doing that may be causing my install to behave a bit differently than what's in the README? Would appreciate any pointers on this!!!

@wavded
Copy link
Owner

wavded commented Nov 21, 2022

Thx for reporting. This is fixed in v4.0.0

@wavded wavded closed this as completed Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants