Closed okpoEkpenyong closed 2 years ago
@okpoEkpenyong This error is related to the module being installed directly from the repo, rather than npm
. https://github.com/xmtp/xmtp-js/pull/81 modifies the install script to address the issue.
Resolved by #81.
Trying to import the network Client from 'smtp-jx',
import { Client } from '@xmtp/xmtp-js'
,crashes the project with the following error:Error: While trying to resolve module
@xmtp/xmtp-jsfrom file
/Users/.../src/screens/Wallet.js. the package
/Users/.../node_modules/@xmtp/xmtp-js/package.jsonwas successfully found. However, this package itself specifies a
mainmodule field that could not be resolved (
/Users/.../node_modules/@xmtp/xmtp-js/index`It appears these references in the package.json are causing the issues:
{ "main": "dist/cjs/src/index.js", "module": "dist/esm/src/index.js", "umd:main": "dist/umd/src/index.js", "types": "dist/types/src/index.d.js", "scripts": { ... } }
My guess is that these referenced paths could not be found in the project, hence the error.