atomiclabs / atomiclabs/hyperdex
Error when decrypting the PouchDB database when using newer Webpack versions
- Dominant language
- JavaScript
- Stars
- 151
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Description
When upgrading from Webpack v4.17.3 to v4.18.0 or later the PouchDB database fails to decrypt. It's really weird as the changes between those Webpack versions seem unrelated: https://github.com/webpack/webpack/compare/v4.17.3...v4.18.0
I've been trying to find a workaround, but I'm honestly not sure why it suddenly stopped working. For now, it's easier to just keep the Webpack version pinned, but I've opened this issue so we can look into it again in the future.
This is the error I get during login:
```
index.js:24 Error: Unsupported state or unable to authenticate data
at StreamCipher../node_modules/browserify-aes/authCipher.js.StreamCipher._final (authCipher.js:92)
at StreamCipher../node_modules/cipher-base/index.js.CipherBase._finalOrDigest (index.js:76)
at decrypt.js:78
```
I tried putting this in the Webpack config:
```js
resolve: {
mainFields: [
'module',
'main'
],
},
```
...to exclude browser dependencies, but I still get the error:
```
index.js:24 Error: Unsupported state or unable to authenticate data
at Decipheriv.final (internal/crypto/cipher.js:175)
at decrypt.js:78
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.