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

@helium/idls package might be misconfigured #336

Open
sagar-a16z opened this issue Jul 25, 2023 · 1 comment
Open

@helium/idls package might be misconfigured #336

sagar-a16z opened this issue Jul 25, 2023 · 1 comment

Comments

@sagar-a16z
Copy link

I'm trying to import the @helium/idls package but I keep getting a module not found error when running the transpiled node.js.

I think this is happening because the package.json for packages/idls doesn't include the following declarations:

 "main": "./lib/cjs/index.js",
 "module": "./lib/esm/src/index.js",
 "types": "./lib/types/src/index.d.ts",
  
 "exports": {
   "import": "./lib/esm/src/index.js",
   "require": "./lib/cjs/index.js",
   "types": "./lib/types/src/index.d.ts"
  },

I think this means that typescript can "build" just fine but node doesn't know where to find the module inside the package.

@sagar-a16z
Copy link
Author

Now I'm not sure if I'm just consuming this incorrectly but for now I'm working around this with a module alias in my package.json

  "_moduleAliases": {
    "@helium/idls/lib/types": "./node_modules/@helium/idls/lib/cjs"
  },

Along with require("module-alias/register"); in my index.ts

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

1 participant