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

[BUG] using this lib with expo web fails during bundling #236

Closed
mirceanis opened this issue Jun 29, 2022 · 3 comments · Fixed by #237
Closed

[BUG] using this lib with expo web fails during bundling #236

mirceanis opened this issue Jun 29, 2022 · 3 comments · Fixed by #237
Labels
bug Something isn't working released

Comments

@mirceanis
Copy link
Member

./node_modules/did-jwt/lib/index.module.js 1635:17
Module parse failed: Unexpected token (1635:17)
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
|               // TODO: should be able to use non base58 keys too
|               return key.type === 'X25519KeyAgreementKey2019' && Boolean(key.publicKeyBase58);
>             })) ?? [];
|             if (!pks.length && !controllerEncrypters.length) throw new Error(`no_suitable_keys: Could not find x25519 key for ${did}`);
|             return pks.map(pk => x25519Encrypter(base58ToBytes(pk.publicKeyBase58), pk.id)).concat(...controllerEncrypters);

using @babel/plugin-proposal-nullish-coalescing-operator doesn't solve it.

@mirceanis mirceanis added the bug Something isn't working label Jun 29, 2022
mirceanis added a commit that referenced this issue Jun 29, 2022
@gasher
Copy link

gasher commented Jul 5, 2022

I also have this issue when using key-did-provider-ed25519

@mirceanis
Copy link
Member Author

I was able to work around this issue by forcing this lib through the transpiler again:

npm i -D @expo/webpack-config
// filename: webpack.config.js
const createExpoWebpackConfigAsync = require('@expo/webpack-config');

module.exports = async function(env, argv) {
    const config = await createExpoWebpackConfigAsync({
        ...env,
        babel: {
            dangerouslyAddModulePathsToTranspile: ['did-jwt', 'ethr-did-resolver']
        }
    }, argv);
    return config;
};

mirceanis added a commit that referenced this issue Jul 21, 2022
uport-automation-bot pushed a commit that referenced this issue Jul 21, 2022
## [6.2.1](6.2.0...6.2.1) (2022-07-21)

### Bug Fixes

* remove nullish coalescing operator ([#237](#237)) ([8cf01de](8cf01de)), closes [#236](#236)
@uport-automation-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 6.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

3 participants