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

Error importing this package #19

Open
elie222 opened this issue Apr 10, 2024 · 1 comment
Open

Error importing this package #19

elie222 opened this issue Apr 10, 2024 · 1 comment

Comments

@elie222
Copy link

elie222 commented Apr 10, 2024

Doing:

import { parseMessage } from '@u22n/mailtools';

Gives this error:

node:internal/errors:496
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in .../node_modules/@u22n/mailtools/package.json

Tried a few variations. Going to see if adjusting my project config can fix it.

@elie222
Copy link
Author

elie222 commented Apr 10, 2024

Manually changed this to this in my node_modules for this package and it worked:

"exports": {
    ".": {
      "import": "./dist/index.js",
      "types": "./dist/index.d.ts"
    }
  },
"exports": {
    ".": "./dist/index.js",
    "./": "./dist/"
  },

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