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

Class methods not imported by bundler? #100

Closed
manzt opened this issue Mar 1, 2020 · 4 comments
Closed

Class methods not imported by bundler? #100

manzt opened this issue Mar 1, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@manzt
Copy link
Member

manzt commented Mar 1, 2020

I noticed in #99 that we are currently importing from geotiff like:

// eslint-disable-next-line import/extensions
import { fromUrl, Pool } from 'geotiff/dist/geotiff.bundle.min.js';

It seems odd to ignore eslint and point to the minified bundle. It should just be,

import { fromUrl, Pool } from 'geotiff';

but this throws an error.

"_decoder2.default is not a constructor"

which is a method on Pool. It seems some es6 class methods are not importing with 3rd party libraries in our build. Specifically, Pool is exported in the but it's missing it's methods. I think this is an issue with our build because I also tried to import a smaller wrapper around zarr that I've been working on and ran into the same issue. This could be related to some of the issues we've had with integrating with vitessce.

@manzt manzt added the bug Something isn't working label Mar 1, 2020
@ilan-gold
Copy link
Collaborator

It's certainly possible that this is a problem with our build but I have had this problem outside of our application as well with this library. Just running create-react-app and importing the Pool and then instantiating it throws the error.

@mccalluc
Copy link
Contributor

mccalluc commented Mar 6, 2020

@ilan-gold : Had you said other folks also had problems with the way geotiff is packaged? I might not be remembering correctly: I don't see any issues there describing exactly this problem.

@ilan-gold
Copy link
Collaborator

ilan-gold commented Mar 6, 2020

geotiffjs/geotiff.js#98 and geotiffjs/geotiff.js#74 both describe issues similar to what I have. I can open an issue with them tomorrow. There might also be something I missed in the threads that say how to solve it but I didn't really glean much. Also, this feels like it's a bug anyway. I haven't given this much attention because the long term plan was to fork the library anyway.

@ilan-gold
Copy link
Collaborator

I think this is resolved now since we use do import from geotiff now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants