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

index is not specified in exports #16

Closed
ChALkeR opened this issue Jul 26, 2024 · 1 comment · Fixed by #19
Closed

index is not specified in exports #16

ChALkeR opened this issue Jul 26, 2024 · 1 comment · Fixed by #19
Labels
good first issue Good for newcomers

Comments

@ChALkeR
Copy link
Member

ChALkeR commented Jul 26, 2024

The example from readme doesn't work:

> require('amaro') // as in readme
Uncaught:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in ./node_modules/amaro/package.json
...
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
> require('amaro/dist/index') // as in Node.js
Uncaught:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/index' is not defined by "exports" in ./node_modules/amaro/package.json
 ...
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
> require('amaro/package.json') // works
{
  name: 'amaro',
  version: '0.0.4',
...
@marco-ippolito
Copy link
Member

marco-ippolito commented Jul 26, 2024

I guess adding

"exports": {
	".": "./dist/index.js",
	"./package.json": "./package.json"

to package.json should fix it, and can probably remove the package.json export, probably export can be remove all together and it should follow the entry point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants