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

node fails with loading module with 5.0.0 #143

Closed
cburgmer opened this issue Jan 14, 2021 · 1 comment
Closed

node fails with loading module with 5.0.0 #143

cburgmer opened this issue Jan 14, 2021 · 1 comment
Labels

Comments

@cburgmer
Copy link

Describe the bug

node fails with loading module with 5.0.0

Code sample or steps to reproduce

Code is in https://github.com/cburgmer/json-path-comparison/tree/master/implementations/JavaScript_jsonpath-plus albeit in a working version with ^4.0.0.

Console error or logs

node:internal/modules/cjs/loader:479
      throw e;
      ^

Error [ERR_INVALID_PACKAGE_TARGET]: Invalid "exports" main target "dist/index-node-umd.js" defined in the package config ./node_modules/jsonpath-plus/package.json; targets must start with "./"
    at new NodeError (node:internal/errors:278:15)
    at throwInvalidPackageTarget (node:internal/modules/esm/resolve:340:9)
    at resolvePackageTargetString (node:internal/modules/esm/resolve:368:5)
    at resolvePackageTarget (node:internal/modules/esm/resolve:405:12)
    at resolvePackageTarget (node:internal/modules/esm/resolve:451:26)
    at packageExportsResolve (node:internal/modules/esm/resolve:506:22)
    at resolveExports (node:internal/modules/cjs/loader:473:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:513:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:911:27)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27) {
  code: 'ERR_INVALID_PACKAGE_TARGET'
}

Environment (IMPORTANT)

  • JSONPath-Plus version: 5.0.0

Tested with
$ node --version
v12.18.2
and
$ node --version
v15.5.1

@brettz9
Copy link
Collaborator

brettz9 commented Jan 14, 2021

Should be fixed in 5.0.1. Was working for ESM, but sorry for the significant glitch for CJS and thanks for the report!

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

No branches or pull requests

2 participants