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

I'm facing issue with cannot import and use it. #52

Open
ThomasLuuu opened this issue Mar 3, 2023 · 4 comments
Open

I'm facing issue with cannot import and use it. #52

ThomasLuuu opened this issue Mar 3, 2023 · 4 comments

Comments

@ThomasLuuu
Copy link

error: Error: While trying to resolve module @digitalbazaar/did-method-key from file C:\Users\***\Work\***\app\lib\did.ts, the package C:\Users\***\Work\***\\node_modules\@digitalbazaar\did-method-key\package.json was s
uccessfully found. However, this package itself specifies a main module field that could not be resolved (C:\Users\***\\Work\***\\node_modules\@digitalbazaar\did-method-key\index. Indeed, none of these files exist:

  • C:\Users*\Work*\node_modules@digitalbazaar\did-method-key\index(.native|.android.jsx|.native.jsx|.jsx|.android.js|.native.js|.js|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.cjs|.native.cjs|.cjs|.
  • C:\Users*\Work*\node_modules@digitalbazaar\did-method-key\index\index(.native|.android.jsx|.native.jsx|.jsx|.android.js|.native.js|.js|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.cjs|.native.cjs|
    .cjs|.android.json|.native.json|.json)
@ThomasLuuu ThomasLuuu reopened this Mar 3, 2023
@dlongley
Copy link
Member

dlongley commented Mar 3, 2023

There's no main entry in the latest version of the package, it instead uses exports:

https://github.com/digitalbazaar/did-method-key/blob/main/package.json#L21

Are you using an older version? If so, please try upgrading to the latest to see if it resolves your problem.

@ThomasLuuu
Copy link
Author

I'm using the latest version of the package.
"@digitalbazaar/did-method-key": "^3.0.0",

@dlongley
Copy link
Member

dlongley commented Mar 3, 2023

It looks like the error message that's coming from whatever you're using to try and load the package is incorrect. There's no main module field in the package.json file. I suspect that the version of whatever you're using to load the module doesn't understand exports. You may need to upgrade your tooling.

@ThomasLuuu
Copy link
Author

I saw that other packages also have exports and they all work fine. I don't know where the problem comes from.

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