xmtp / xmtp-js

XMTP client SDKs for JavaScript applications.

Home Page:https://xmtp.org/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: Module not found

emmajane1313 opened this issue ยท comments

Describe the bug

I reported an issue the other day around this and the was a version update to the sdk but there is now another error that its impeding the project from compiling/building, using the latest versions of both packages:

"@xmtp/react-sdk": "4.0.0",
"@xmtp/xmtp-js": "11.3.4",

unhandledRejection node_modules/@xmtp/xmtp-js/dist/index.js:7
import { keccak256 } from 'js-sha3';
         ^^^^^^^^^
SyntaxError: Named export 'keccak256' not found. The requested module 'js-sha3' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'js-sha3';
const { keccak256 } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15) {
  type: 'SyntaxError'
}
   Collecting page data  .%   

Expected behavior

No response

Steps to reproduce the bug

No response

I can reproduce this issue. v11.3.2 works fine, but v11.3.3 and onward seems broken due to this commit bring in the js-sha3 dependency:

4b0c138#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519

I've tried using below v11.3.3 with 11.3.2 and 11.3.1 and the error still persists.

๐ŸŽ‰ This issue has been resolved in version 11.3.5 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

@emmajane1313 are you still seeing this in the latest 11.3.5 release? Please feel free to reopen if so. Would also love to connect on what you're building! Thanks for the bug report.

@nplasterer yes working great now! Thanks for the help. Sure, would love to speak more. Integrating XMTP into a bunch of Lens connected applications. Btw, is your grants program currently active?

@emmajane1313 Amazing. I'd love to test out any of the things you're working on in lens I'm nplasterer.eth you can DM me there as well. I know we've got plans to bring back the grants program and @petermdenton is in charge of that. Would you be willing to chat with him? You can dm him at petermdenton.eth.

@nplasterer awesome sounds great, i'll connect with you and peter over there!