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

Problem importing 2.0 beta #57

Open
HarelM opened this issue Dec 5, 2018 · 5 comments
Open

Problem importing 2.0 beta #57

HarelM opened this issue Dec 5, 2018 · 5 comments

Comments

@HarelM
Copy link

HarelM commented Dec 5, 2018

I've tried to use the latest version but I wan't able to use it like I did with 1.0.4:
I'm using webpack.
this doesn't work:
import piexif from "piexifjs";
Also this didn't work:
import * as piexif from "piexifjs";
I don't have other ideas I can try :-(

@HarelM
Copy link
Author

HarelM commented Dec 5, 2018

Apparently, all methods have been moved to export so the usage is like so:
import { load, dump, insert, TagValues, helper } from "piexifjs";
Probably a documentation update is needed...

@hMatoba
Copy link
Owner

hMatoba commented Dec 6, 2018

Thank you for trying new version!

I want to reproduce error. Error is thrown by webpack? Could you tell me the error message?

@HarelM
Copy link
Author

HarelM commented Dec 6, 2018

Thanks for the quick response!
No error is thrown by webpack but the error is thrown on runtime - can't call laod of undefined.
The only issue here is that I used this library wrong due to breaking changes in 2.0 version... :-(
Nevertheless, I think the solution is to update the documentation and create typescript typing to allow users to have intellisense and auto complete when using typescript (which is what I use and anyone who writes angular code).
See here how to add the typings to the project:
https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html

@hMatoba
Copy link
Owner

hMatoba commented Dec 6, 2018

I added TypeScript definition. But it's not enough.
Welcome PullRequest.

@HarelM
Copy link
Author

HarelM commented Dec 6, 2018

hmm, interesting, I wonder why I don't get proper intellisense then...
Looking at the generated index.d.ts file I think the interfaces folder is missing in the released package:
import * as interfaces from './interfaces';

image

image

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