web-eid / web-eid.js

Add secure authentication and digital signing with electronic ID smart cards to web apps with the Web eID JavaScript library
https://web-eid.eu
MIT License
39 stars 18 forks source link

Module not found: Error: Can't resolve '@web-eid/web-eid-library' #39

Closed ydanneg closed 6 months ago

ydanneg commented 1 year ago

I have TS React project where I would like to use web-eid.js.

Dependency:

Screenshot 2023-03-14 at 13 15 13

Import:

Screenshot 2023-03-14 at 13 10 55

I get an error:

Screenshot 2023-03-14 at 13 52 38

I created a simple project to reproduce it: https://github.com/ydanneg/web-eid-sample

How can I use web-eid in my project?

PS. I'm not a web developer.

PPS. Documentation seems to be outdated

Screenshot 2023-03-14 at 13 55 01
vatsake commented 1 year ago

For me, this works: import { getSigningCertificate, sign } from '@web-eid/web-eid-library/web-eid'

mrts commented 1 year ago

Thanks for the tip, @vatsake! We intend to make the following work and update docs accordingly (this is an example for the future that does not currently work, for now, please use the API according to the example in @vatsake comment):

import { getSigningCertificate, sign } from '@web-eid/web-eid-library'

However, as this is a minor developer experience issue, it is not top priority, so it will take some time until we get there. Feel free to upvote this.