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

main/require index.cjs are defined in package.json, but not part of published dist #77

Closed
thepiwo opened this issue Aug 5, 2024 · 3 comments

Comments

@thepiwo
Copy link

thepiwo commented Aug 5, 2024

the package.json defines:

  ...
  "main": "./dist/index.cjs",
  ...
  "exports": {
    ".": {
      "require": "./dist/index.cjs",
      ...
    }
  },

but the published dist doesn't seem to include this: https://www.npmjs.com/package/@bonfida/spl-name-service?activeTab=code

resulting in me trying to use it with tsx:

> tsx ./src/index.ts

node:internal/modules/cjs/loader:1070
  const err = new Error(`Cannot find module '${request}'`);
              ^

Error: Cannot find module '.../node_modules/@bonfida/spl-name-service/dist/index.cjs'
    at createEsmNotFoundErr (node:internal/modules/cjs/loader:1070:15)
    at finalizeEsmResolution (node:internal/modules/cjs/loader:1063:15)
    at resolveExports (node:internal/modules/cjs/loader:547:14)
    at Module._findPath (node:internal/modules/cjs/loader:621:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1034:27)
    at nextResolveSimple (.../node_modules/tsx/dist/register-C1urN2EO.cjs:3:942)
    at .../node_modules/tsx/dist/register-C1urN2EO.cjs:2:2486
    at .../node_modules/tsx/dist/register-C1urN2EO.cjs:2:1560
    at resolveTsPaths (.../node_modules/tsx/dist/register-C1urN2EO.cjs:3:760)
    at .../node_modules/tsx/dist/register-C1urN2EO.cjs:3:1035 {
  code: 'MODULE_NOT_FOUND',
  path: '.../node_modules/@bonfida/spl-name-service/package.json'
}

Node.js v20.9.0

(replaced my absolute path with ...)

@akashrdev
Copy link
Contributor

Hi, thank you for raising this. We will look into it and update you.

@dr497
Copy link
Contributor

dr497 commented Aug 6, 2024

@thepiwo Thank you for opening the issue. I believe this PR should fix the issue you have found #79

@dr497
Copy link
Contributor

dr497 commented Aug 7, 2024

@thepiwo This should be fixed in 3.0.1

@dr497 dr497 closed this as completed Aug 7, 2024
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

3 participants