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

Please update to [email protected] to allow Node build tools for client JS #33

Open
forevermatt opened this issue May 8, 2020 · 1 comment

Comments

@forevermatt
Copy link

When trying to build my client-side JavaScript (which uses your @webauthn/client) using rollup, Unibabel 2 throws an Error because it's not designed for use in a Node context. In Unibabel 3, they added support for Node use.

Alternatively, if you can explain how you got Unibabel 2 to work in your "example/front" code, that would be helpful. Apparently you got past this somehow, but reading through your code I still haven't figured out how.

(Thanks)

@forevermatt forevermatt changed the title Please update to [email protected] to allow Node build tools for client JS Please update to [email protected] to allow Node build tools for client JS May 8, 2020
@forevermatt
Copy link
Author

Until a node-based build process is available and/or I figure out how to do that with the current version of this library, it turns out that I can simply copy the @webauthn/client library's "dist/main.js" into my client side files, then pull it into my HTML file with a script tag. I can then reference its functions using window.functionName() (e.g. window.solveRegistrationChallenge(...)).

I did try using npm-force-resolutions to force my code to use [email protected], but the public interface for things has changed from what was used in 2.x (not surprisingly, since it's a major version bump, implying backwards-compatibility-breaking changes), so the @webauthn/client code doesn't work if I'm using Unibabel 3.0.0.

I'll stick with simply loading in the webauthn-client.js (copied/renamed from @webauthn/client's "dist/main.js" file) for now, because that works.

(Thanks Wallix for making this library available, even if I am struggling a little with the learning curve.)

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

1 participant