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

Webpack 4 - Error on Compilation #452

Closed
pierpaolovannidocplanner opened this issue Dec 20, 2023 · 1 comment
Closed

Webpack 4 - Error on Compilation #452

pierpaolovannidocplanner opened this issue Dec 20, 2023 · 1 comment

Comments

@pierpaolovannidocplanner

Hello, i'm installing otpauth using Yarn 4
I use Webpack 4 as bundler but i have the following error during compilation:

[3] ERROR in ./node_modules/otpauth/dist/otpauth.esm.js 970:28
[3] Module parse failed: Unexpected token (970:28)
[3] You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
[3] | const randomBytes = size => {
[3] |   {
[3] >     if (!globalScope.crypto?.getRandomValues) {
[3] |       throw new Error("Cryptography API not available");
[3] |     }
[3]  @ ./js/app.js 40:0-35 153:17-29
[3]  @ ./js/main.js
@hectorm
Copy link
Owner

hectorm commented Jan 18, 2024

It seems that the optional chaining (?.) operator is not supported in your setup, it does not seem to be a problem with OTPAuth.

@hectorm hectorm closed this as completed Jan 27, 2024
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