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 [ERR_INVALID_PACKAGE_TARGET]: Invalid "exports" main target "dist/src/semantic_locators.js" #95

Closed
icy0307 opened this issue Jul 15, 2022 · 0 comments · Fixed by #96
Labels
bug Something isn't working

Comments

@icy0307
Copy link

icy0307 commented Jul 15, 2022

Describe the bug
Invalid exports path in package.json, cause require module failed.

According to this documentation , "All paths defined in the "exports" must be relative file URLs starting with ./.".
However we got

  "exports": {
    ".": {"require": "dist/src/semantic_locators.js"},
    "./gen":{"require": "dist/src/gen/index.js"}
  },

image

@
To Reproduce
Steps to reproduce the behavior:
When ever require semantic locator into a js file, and run it directly in node (without any other module resolver , like webpack , or even jest)
this log come along:

Error [ERR_INVALID_PACKAGE_TARGET]: Invalid "exports" main target "dist/src/semantic_locators.js" defined in the package config /xxx/node_modules/semantic-locator/package.json;
 targets must start with "./"

Expected behavior
can be required successfully.

Screenshots
image

Environment (please complete the following information):

  • OS: [e.g. Windows]
  • Browser and version: [e.g. Chrome v87]
  • Semantic Locators environment [e.g. JavaScript, Java WebDriver, All]

Additional context
Add any other context about the problem here.

@icy0307 icy0307 added the bug Something isn't working label Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant